Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
259 commits
Select commit Hold shift + click to select a range
fd9a60e
#289 ComponentSettings: Quit default export
zaki-yama May 26, 2019
0bdd6a6
#289 MediaObject: mv .js -> .tsx
zaki-yama May 26, 2019
6af4548
#289 MediaObject: Convert PropTypes to TypeScript types
zaki-yama May 26, 2019
4237570
#289 MediaObject: mv story .js -> .tsx
zaki-yama May 26, 2019
6454422
#289 MediaObject: Quit default export
zaki-yama May 26, 2019
7bd1a35
#289 Radio: mv .js -> .tsx
zaki-yama May 26, 2019
d1a11f9
#289 Radio: Convert PropTypes to TypeScript types
zaki-yama May 26, 2019
7b1f393
#289 Radio: mv story .js -> .tsx
zaki-yama May 26, 2019
27819c9
#289 Radio: Use `InputHTMLAttributes` instead of `HTMLAttributes`
zaki-yama May 26, 2019
aa5c492
#289 Radio: Fix type errors of addon-knobs
zaki-yama May 26, 2019
404c31b
#289 Radio: Quit default export
zaki-yama May 26, 2019
f21617d
#289 Radio: Update storyshots
zaki-yama May 26, 2019
4fb9a1a
#289 RadioGroup: mv .js -> .tsx
zaki-yama May 26, 2019
41809d5
#289 RadioGroup: Convert PropTypes to TypeScript types
zaki-yama May 28, 2019
a1c0065
#289 RadioGroup: Declare `isFormElement` as static property
zaki-yama May 28, 2019
48dd782
#289 RadioGroup: Quit default export
zaki-yama May 28, 2019
180cd34
#289 FormElement: mv .js -> .tsx
zaki-yama May 28, 2019
53bee4a
#289 FormElement: Convert PropTypes to TypeScript types
zaki-yama May 30, 2019
3b44e8d
#289 FormElement: Quit default export
zaki-yama May 30, 2019
5a7090f
#289 FormElement: Delete FormElement.propTypes.error
zaki-yama Jun 3, 2019
4638ca9
#289 Form: mv .js -> .tsx
zaki-yama May 30, 2019
f221f3c
#289 Form: Convert PropTypes to TypeScript types
zaki-yama Jun 3, 2019
5224793
#289 Form: mv story .js -> .tsx
zaki-yama Jun 3, 2019
5d86ab4
Revert "#289 Form: mv story .js -> .tsx"
zaki-yama Jun 5, 2019
dfe2f67
#289 Form: Add `FormHTMLAttributes`
zaki-yama Jun 5, 2019
703b933
#289 Form: mv test .js -> .tsx
zaki-yama Jun 5, 2019
02d217c
#289 Form: Quit default export
zaki-yama Jun 5, 2019
4e226ad
#289 Text: mv .js -> .tsx
zaki-yama Jun 5, 2019
d90c232
#289 Convert PropTypes to TypeScript types
zaki-yama Jun 5, 2019
9fc47ff
#289 Text: mv test .js -> .tsx
zaki-yama Jun 5, 2019
debcc78
#289 Text: Quit default export
zaki-yama Jun 5, 2019
1edb091
#289 Textarea: mv .js -> .tsx
zaki-yama Jun 5, 2019
879ef6c
#289 Textarea: Convert PropTypes to TypeScript types
zaki-yama Jun 5, 2019
7ea6e21
#289 Textarea: mv story .js -> .tsx
zaki-yama Jun 7, 2019
2ed4f9c
#289 Textarea: Add TextareaHTMLAttributes
zaki-yama Jun 7, 2019
306df10
#289 Textarea: Fix type errors in story
zaki-yama Jun 7, 2019
c96fed3
#289 Textarea: Quit default export
zaki-yama Jun 7, 2019
f699b29
#289 Textarea: Update storyshots
zaki-yama Jun 7, 2019
f29fcd7
#289 Container: mv .js -> .tsx
zaki-yama Jun 9, 2019
31460eb
#289 Container: Convert PropTypes to TypeScript types
zaki-yama Jun 9, 2019
c95c080
#289 Container: Quit default export
zaki-yama Jun 9, 2019
6794472
#289 util: mv .js -> .ts
zaki-yama Jun 10, 2019
d3e3673
#289 util: import @types/uuid
zaki-yama Jun 10, 2019
2a9310b
#289 util: Give TypeScript types
zaki-yama Jun 10, 2019
2e894a8
#289 util: Delete unused function `updateScroll`
zaki-yama Jun 10, 2019
c2ee29c
#289 Tree: mv .js -> .tsx
zaki-yama Jun 7, 2019
a453987
#289 Tree: Convert PropTypes to TypeScript types
zaki-yama Jun 12, 2019
e6acf2e
#289 Tree: mv story .js -> .tsx
zaki-yama Jun 12, 2019
084342a
#289 Tree: Fix type error of knobs
zaki-yama Jun 17, 2019
6e14a0d
#289 Tree: Fix React's runtime warnings
zaki-yama Jun 17, 2019
5acad3b
#289 Tree: Update storyshots
zaki-yama Jun 17, 2019
3771565
#289 Tree: Quit default export
zaki-yama Jun 17, 2019
65e5137
#289 Tree: tweak
zaki-yama Jun 17, 2019
baeeee6
#289 TreeNode: mv .js -> .tsx
zaki-yama Jun 17, 2019
2ade7ee
#289 TreeNode: Convert PropTypes to TypeScript types
zaki-yama Jun 19, 2019
6da253b
#289 TreeNode: Quit default export
zaki-yama Jun 19, 2019
23c9656
#289 Spinner: mv .js -> .tsx
zaki-yama Jun 21, 2019
8a6fbc7
#289 Spinner: Convert propTypes to TypeScript types
zaki-yama Jun 21, 2019
6c9a1f9
#289 Spinner: mv story .js -> .tsx
zaki-yama Jun 21, 2019
b5a6aed
#289 Spinner: Fix story's type errors
zaki-yama Jun 21, 2019
96d1acf
#289 Spinner: Quit default export
zaki-yama Jun 21, 2019
fd9d863
#289 Spinner: Change initial value of `size` to "small"
zaki-yama Jun 21, 2019
c26166e
#289 Spinner: Add `HTMLAttributes<HTMLDivElement>` to props
zaki-yama Jun 21, 2019
6b7e29c
#289 Spinner: Stop using defaultProps
zaki-yama Jun 27, 2019
b438ac3
#289 Spinner: Handle empty string for `size` in story
zaki-yama Jul 1, 2019
c3959bf
Revert "#289 Spinner: Handle empty string for `size` in story"
zaki-yama Jul 1, 2019
7050890
#289 Spinner: Add a comment about knobs
zaki-yama Jul 1, 2019
3929d3a
#289 Spinner: Fix type definition of props in constructor
zaki-yama Jul 2, 2019
04ca3ef
#289 Spinner: Manually set type for destructuring assignment
zaki-yama Jul 9, 2019
495e358
#289 Spinner: `SpnnerProps` should contain `HTMLAttributes`
zaki-yama Jul 9, 2019
fee9dc2
#289 Spinner: Workaround for passing undefined in story
zaki-yama Jul 9, 2019
20f4ef8
#289 HTMLAttributes should be included in its own props
zaki-yama Jul 9, 2019
1ceaac9
#289 Icon: mv .js -> .tsx
zaki-yama Jun 23, 2019
4aff676
#289 Icon: Install @types/svg4everybody
zaki-yama Jun 23, 2019
73728f5
#289 Icon: Convert propTypes to TypeScript types
zaki-yama Jun 23, 2019
426058f
#289 Icon: Add non-null assertion when passing `icon` props in Button…
zaki-yama Jun 23, 2019
becd1f8
#289 Icon: Avoid passing textColor={null} in ButtonIcon
zaki-yama Jun 23, 2019
e68bd88
#289 Icon: `pointerEvents` should not be included in `style`
zaki-yama Jun 23, 2019
77f13f7
#289 Icon: Fix type error of `getComputedStyle`
zaki-yama Jun 23, 2019
218d483
#289 Button: Change `icon` of ButtonIcon to required props
zaki-yama Jul 1, 2019
893353b
#289 Icon: HTMLAttributes is unused
zaki-yama Jul 1, 2019
3ab2940
#289 Icon: Accept null in `textColor`
zaki-yama Jul 1, 2019
230c7f5
#289 Icon: Update snapshot
zaki-yama Jul 1, 2019
378b622
#289 Icon: mv story .js -> .tsx
zaki-yama Jul 1, 2019
ffac4b8
#289 Icon: Fix story type errors
zaki-yama Jul 2, 2019
f91bd50
#289 Icon: Delete unnecessary eslint-disable comments
zaki-yama Jul 2, 2019
d6c5492
#289 Icon: mv test .js -> .tsx
zaki-yama Jul 2, 2019
617903a
#289 Icon: Install @types/power-assert
zaki-yama Jul 2, 2019
581065a
#289 Icon: Quit default export
zaki-yama Jul 6, 2019
b122cb3
#289 Pill: mv .js -> .tsx
zaki-yama Jul 2, 2019
2724222
#289 Pill: Convert propTypes to TypeScript types
zaki-yama Jul 6, 2019
581787e
#289 Pill: Quit default export
zaki-yama Jul 6, 2019
34173ad
#289 Picklist: mv .js -> .tsx
zaki-yama Jul 8, 2019
e3eb597
#289 Picklist: Convert propTypes to TypeScript types
zaki-yama Jul 12, 2019
85be964
#289 Picklist: Delete unused vars
zaki-yama Jul 12, 2019
615d3ce
#289 Picklist: Use destructuring assignment instead of defaultProps
zaki-yama Jul 12, 2019
d314ae7
#289 Picklist: tweak
zaki-yama Jul 12, 2019
222f25c
#289 Picklist: mv story .js -> .tsx
zaki-yama Jul 12, 2019
8b94c64
#289 Picklist: Delete unused import PropTypes
zaki-yama Jul 12, 2019
12e2cd4
#289 Picklist: Fix type errors in story
zaki-yama Jul 12, 2019
8919798
#289 Picklist: Add `disabled` prop to PicklistItem
zaki-yama Jul 12, 2019
7b4f0bd
#289 Picklist: Fix eslint errors
zaki-yama Jul 12, 2019
6567ff9
#289 Picklist: Update storyshots
zaki-yama Jul 12, 2019
858dd3d
#289 Picklist: mv test .js -> .tsx
zaki-yama Jul 12, 2019
d9f01e9
#289 Quit default export
zaki-yama Jul 12, 2019
01579e1
#289 Picklist: assign null as class property
zaki-yama Jul 13, 2019
a0b0e6d
#289 Button: Assign null as initial value of class property
zaki-yama Jul 13, 2019
fd0b348
#289 AutoAlign: mv AutoAlign.js -> AutoAlign.tsx
zaki-yama May 17, 2019
7721e86
#289 AutoAlign: Declare module for `react-relative-portal`
zaki-yama May 20, 2019
370c390
#289 AutoAlign: Add types to arguments of functions
zaki-yama May 23, 2019
8068794
#289 AutoAlign: Declare private fields
zaki-yama May 23, 2019
f883f62
#289 AutoAlign: Convert propTypes to TypeScript type
zaki-yama Jul 18, 2019
8352e4e
#289 AutoAlign: Quit default export
zaki-yama Jul 24, 2019
e843de6
#289 AutoAlign: InjectedProps of AutoAlignProps should be optional
zaki-yama Aug 5, 2019
764166a
#289 AutoAlign: AutoAlignProps should be optional
zaki-yama Aug 5, 2019
fcae146
#289 DropdownMenu: mv .js -> .tsx
zaki-yama Jul 7, 2019
c111ee3
#289 DropdownMenu: Convert propsTypes to TypeScript types
zaki-yama Jul 27, 2019
d317905
#289 DropdownMenu: Add `AnchorHTMLAttributes` to DropdownMenuItemProps
zaki-yama Aug 5, 2019
5b2c1a0
#289 DropdownMenu: Fix Piclist's type error
zaki-yama Aug 5, 2019
eda6d30
#289 DropdownMenu: Quit default export
zaki-yama Aug 6, 2019
eb9f55b
#289 DropdownMenu: Update storyshots
zaki-yama Aug 6, 2019
9891352
#289 DropdownMenu: Delete unused argument
zaki-yama Sep 13, 2019
98c6f2c
#289 DropdownMenu: Make `node` public
zaki-yama Sep 13, 2019
634fb0c
#289 DropdownButton: mv .js -> .tsx
zaki-yama Aug 6, 2019
9cd9c33
#289 DropdownButton: Convert PropTypes to TypeScript types
zaki-yama Aug 10, 2019
ef639a1
#289 DropdownButton: mv story .js -> .tsx
zaki-yama Aug 10, 2019
9090db2
#289 DropdownButton: Fix type errors of story
zaki-yama Aug 12, 2019
7b7c51f
#289 DropdownButton: Add `icon-border-inverse` to ButtonType
zaki-yama Aug 12, 2019
d3ab3c9
#289 DropdownButton: Quit default export
zaki-yama Aug 12, 2019
702b8b6
#289 DropdownButton: Make node fields public
zaki-yama Sep 13, 2019
16c0925
#289 DropdownButton: Delete unused method
zaki-yama Sep 13, 2019
efb5e85
#289 Input: mv .js -> .tsx
zaki-yama Aug 12, 2019
a576d05
#289 Input: Convert PropTypes to TypeScript types
zaki-yama Aug 12, 2019
a13ec73
#289 Input: mv story .js -> .tsx
zaki-yama Aug 12, 2019
94f0cf3
#289 Input: Fix type errors of story
zaki-yama Aug 12, 2019
81591f4
#289 Input: Quit default export
zaki-yama Aug 12, 2019
84fb7d8
#289 Input: Update storyshots
zaki-yama Aug 12, 2019
48f2583
#289 Lookup: mv .js -> .tsx
zaki-yama Aug 13, 2019
f478471
#289 Lookup: Convert PropTypes to TypeScript types
zaki-yama Aug 19, 2019
29c785f
#289 Lookup: mv story .js -> .tsx
zaki-yama Aug 19, 2019
716a046
#289 Lookup: Fix type errors of story
zaki-yama Aug 19, 2019
c45d204
#289 Lookup: Quit default export
zaki-yama Aug 19, 2019
1873757
#289 Pill: Add HTMLAttributes to props
zaki-yama Sep 13, 2019
ef66910
#289 Lookup: Don't use private field for element
zaki-yama Sep 13, 2019
dbbcbf9
#289 Lookup: Update storyshots
zaki-yama Sep 14, 2019
f0edd83
#289 FieldSet: mv .js -> .tsx
zaki-yama Aug 19, 2019
0d426ae
#289 FieldSet: Convert PropTypes to TypeScript types
zaki-yama Aug 19, 2019
c83c7d5
#289 FieldSet: Quit default export
zaki-yama Aug 19, 2019
ae72798
#289 FieldSet: Use `React.FC` like other function components
zaki-yama Sep 14, 2019
b3b7746
#289 Toggle: mv .js -> .tsx
zaki-yama Aug 19, 2019
defc7a4
#289 Toggle: Convert PropTypes to TypeScript types
zaki-yama Aug 19, 2019
24c926b
#289 Toggle: mv story .js -> .tsx
zaki-yama Aug 19, 2019
a0fd12b
#289 Toggle: Fix type errors of story
zaki-yama Aug 19, 2019
18cac30
#289 Toggle: Quit default export
zaki-yama Aug 19, 2019
4569910
#289 Toggle: Don't use private field for element
zaki-yama Sep 14, 2019
0850c7e
#289 Toggle: Update storyshots
zaki-yama Sep 14, 2019
45da653
#289 Checkbox: mv .js -> .tsx
zaki-yama Aug 21, 2019
b954387
#289 Checkbox: Convert PropTypes to TypeScript types
zaki-yama Aug 27, 2019
fde2a2e
#289 Checkbox: mv story .js -> .tsx
zaki-yama Aug 27, 2019
0c2b564
#289 Checkbox: Fix type errors of story
zaki-yama Aug 27, 2019
b254fc3
#289 Checkbox: Quit default export
zaki-yama Aug 27, 2019
27c526b
#289 Checkbox: Don't use private field for element
zaki-yama Sep 14, 2019
e476295
#289 CheckboxGroup: mv .js -> .tsx
zaki-yama Aug 27, 2019
1d1ce36
#289 CheckboxGroup: Convert PropTypes to TypeScript types
zaki-yama Aug 27, 2019
cb9b8d4
#289 CheckboxGroup: Quit default export
zaki-yama Aug 27, 2019
e87f297
#289 CheckboxGroup: Fix typo in story
zaki-yama Aug 27, 2019
207a8d9
#289 CheckboxGroup: Preserve checkbox nodes in nested private field
zaki-yama Sep 14, 2019
2739b0f
#289 Select: mv .js -> .tsx
zaki-yama Aug 27, 2019
66b7ce4
#289 Select: Convert PropTypes to TypeScript types
zaki-yama Aug 27, 2019
adf5f5b
#289 Select: mv story .js -> .tsx
zaki-yama Aug 27, 2019
f821bef
#289 Select: Fix type errors of story
zaki-yama Aug 27, 2019
8d5b98e
#289 Select: Update storyshots
zaki-yama Aug 27, 2019
521316c
#289 Select: Quit default export
zaki-yama Aug 27, 2019
4adc507
#289 Notification: mv .js -> .tsx
zaki-yama Aug 27, 2019
20ff65f
#289 Notification: Convert PropTypes to TypeScript types
zaki-yama Aug 27, 2019
c558e91
#289 Notification: mv test .js -> .tsx
zaki-yama Aug 27, 2019
3856346
#289 Notification: mv story .js -> .tsx
zaki-yama Aug 27, 2019
ec3dba5
#289 Notification: Fix type errors of story
zaki-yama Aug 27, 2019
0d5506b
#289 Notification: Fix typo in story
zaki-yama Aug 27, 2019
7007352
#289 Notification: Quit default export
zaki-yama Aug 27, 2019
8318589
#289 SalesPath: mv .js -> .tsx
zaki-yama Aug 28, 2019
141906a
#289 SalesPath: Convert PropTypes to TypeScript types
zaki-yama Aug 28, 2019
4cabe35
#289 SalesPath: Quit default export
zaki-yama Aug 28, 2019
972dd47
#289 Modal: mv .js -> .tsx
zaki-yama Aug 28, 2019
b6ceb2f
#289 Modal: Convert PropTypes to TypeScript types
zaki-yama Aug 28, 2019
048f708
#289 Modal: mv story .js -> .tsx
zaki-yama Aug 28, 2019
d5baafa
#289 Modal: Fix type errors of story
zaki-yama Aug 28, 2019
a5f19e0
#289 Modal: Quit default export
zaki-yama Aug 28, 2019
89f57bf
#289 Modal: Delete `import PropTypes`
zaki-yama Aug 28, 2019
735feec
#289 Modal: Downgrade SLDS from 2.8.3 to 2.4.5
zaki-yama Sep 18, 2019
b3daecd
Revert "#289 FieldSet: Use `React.FC` like other function components"
zaki-yama Sep 22, 2019
6cf1fcc
#289 Modal: Update storyshots
zaki-yama Sep 22, 2019
77613c7
#289 Popover: mv .js -> .tsx
zaki-yama Aug 29, 2019
55a9ace
#289 Popover: install @types/react-dom
zaki-yama Aug 29, 2019
96183dc
#289 Popover: Convert PropTypes to TypeScript types
zaki-yama Aug 31, 2019
5c92826
#289 Popover: Use default value of object destructuring assignment in…
zaki-yama Aug 31, 2019
56cd166
#289 Popover: mv story .js -> .tsx
zaki-yama Aug 31, 2019
87af70a
#289 Popover: `cleanProps` is no longer needed
zaki-yama Aug 31, 2019
b95528e
#289 Popover: Fix type errors of story
zaki-yama Aug 31, 2019
dd45b05
#289 Popover: `position` should be optional
zaki-yama Aug 31, 2019
8c4c98f
#289 Popover: Quit default export
zaki-yama Aug 31, 2019
a0eb312
#289 Popover: Fix default value in story
zaki-yama Sep 22, 2019
20e85ae
#289 Grid: mv .js -> .tsx
zaki-yama Sep 2, 2019
8460af6
#289 Grid: Convert PropTypes to TypeScript types
zaki-yama Sep 2, 2019
111e0c0
#289 Grid: mv story .js -> .tsx
zaki-yama Sep 5, 2019
fb8f945
#289 Grid: Fix type error
zaki-yama Sep 5, 2019
86667c1
#289 Grid: Delete PropTypes used in story
zaki-yama Sep 5, 2019
fd692c0
#289 Grid: Improve type definition
zaki-yama Sep 5, 2019
ed08100
#289 Grid: Quit default export
zaki-yama Sep 5, 2019
a806ccd
#289 PageHeader: mv .js -> .tsx
zaki-yama Sep 5, 2019
3addd8c
#289 PageHeader: Convert PropTypes to TypeScript types
zaki-yama Sep 8, 2019
81c294e
#289 PageHeader: mv story .js -> .tsx
zaki-yama Sep 8, 2019
1911dbc
#289 PageHeader: Fix type errors in story
zaki-yama Sep 9, 2019
cd70896
#289 PageHeader: Quit default export
zaki-yama Sep 10, 2019
30f2435
#289 PageHeader: Use Fragment to resolve type error
zaki-yama Sep 22, 2019
4ba192c
#289 Tabs: mv .js -> .tsx
zaki-yama Sep 10, 2019
d4f9208
#289 Tabs: Convert PropTypes to TypeScript types
zaki-yama Sep 29, 2019
b0813f4
#289 Tabs: mv story .js -> .tsx
zaki-yama Sep 29, 2019
efb04f3
#289 Tabs: Define TabType
zaki-yama Sep 29, 2019
75e1936
#289 Tabs: Accept arbitrary props for tabItemRenderer
zaki-yama Sep 29, 2019
ab91ec9
#289 Tabs: Fix type error in story
zaki-yama Sep 29, 2019
dc6d14a
#289 Tabs: Quit default export
zaki-yama Sep 29, 2019
fa67f84
#289 Tabs: Define TabItemRendererProps
zaki-yama Oct 21, 2019
b8f664c
#289 Table: mv .js -> .tsx
zaki-yama Sep 29, 2019
2583d6d
#289 Table: Convert PropTypes to TypeScript types
zaki-yama Sep 29, 2019
19b1bb7
#289 Table: mv story .js -> .tsx
zaki-yama Sep 29, 2019
c2cfe1b
#289 Table: Fix type errors of story
zaki-yama Sep 29, 2019
0b72cf0
#289 Table: Quit default export
zaki-yama Sep 29, 2019
2813e37
#289 Table: Accept `width` props in TableRowColumn
zaki-yama Oct 1, 2019
cffe6cb
#289 Table: Update storyshots
zaki-yama Oct 3, 2019
5e1a9ef
#289 Datepicker: mv .js -> .tsx
zaki-yama Sep 29, 2019
086760e
#289 Datepicker: Convert PropTypes to TypeScript types
zaki-yama Sep 29, 2019
53f32da
#289 Datepicker: mv story .js -> .tsx
zaki-yama Sep 29, 2019
f223061
#289 Datepicker: Fix type errors of story
zaki-yama Sep 29, 2019
faa8952
#289 Datepicker: Quit default export
zaki-yama Sep 29, 2019
8caa24d
#289 Datepicker: Cast to number to fix the type error
zaki-yama Oct 3, 2019
f2f63da
#289 DateInput: mv .js -> .tsx
zaki-yama Oct 6, 2019
5462a56
#289 DateInput: Convert PropTypes to TypeScript types
zaki-yama Oct 11, 2019
728f837
#289 DateInput: mv story .js -> .tsx
zaki-yama Oct 13, 2019
c0f0f08
#289 DateInput: Fix type errors of story
zaki-yama Oct 13, 2019
fe0ab7f
#289 DateInput: Quit default export
zaki-yama Oct 13, 2019
911c047
#289 DateInput: Quit using @ts-ignore
zaki-yama Oct 21, 2019
1067e5d
#289 DateInput: Check if `this.props.onComplete` exists again in `set…
zaki-yama Oct 21, 2019
ce60779
#289 Form: mv story .js -> .tsx
zaki-yama Oct 13, 2019
c925cb0
#289 Form: Fix type errors of story
zaki-yama Oct 13, 2019
049331f
#289 Form: Update storyshots
zaki-yama Oct 13, 2019
15e38fe
#289 mv stories/data/*.js -> *.ts
zaki-yama Oct 13, 2019
c6bd22e
#289 mv index.js -> index.ts
zaki-yama Oct 13, 2019
8ffdb43
Merge branch '3.0' into typescript-index-and-data
stomita Oct 28, 2019
aee2a60
fix lint error
stomita Oct 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ addDecorator(withKnobs);
addDecorator(wrapContent({ assetRoot }));

configure(() => {
require('../stories/index.js');
require('../stories/index.ts');
}, module);
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"storybook": "start-storybook -s ./node_modules/@salesforce-ux/design-system -p 9001 -c .storybook",
"test": "npm-run-all type-check test:jest test:storyshots",
"test:storyshots": "NODE_ENV=test jest test/storyshots/*.test.js",
"test:jest": "jest test/*-spec.js",
"test:jest": "jest test/*-spec.js test/*-spec.tsx",
"prepublish": "npm run build",
"type-check": "tsc --noEmit",
"type-check:watch": "npm run type-check -- --watch",
Expand Down Expand Up @@ -72,10 +72,14 @@
"@types/classnames": "^2.2.7",
"@types/enzyme": "^3.9.1",
"@types/jest": "^24.0.11",
"@types/power-assert": "^1.5.0",
"@types/react": "^16.8.12",
"@types/react-dom": "^16.9.0",
"@types/storybook__addon-actions": "^3.4.2",
"@types/storybook__addon-knobs": "^5.0.0",
"@types/storybook__react": "^4.0.1",
"@types/svg4everybody": "^2.1.1",
"@types/uuid": "^3.4.4",
"@typescript-eslint/eslint-plugin": "^1.5.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
Expand Down Expand Up @@ -107,7 +111,7 @@
"@types/react": "^16.8.12"
},
"jest": {
"testRegex": "(/test/.*|\\.(test|spec))\\.js$",
"testRegex": "(/test/.*|\\.(test|spec))\\.(js|tsx)$",
"setupFilesAfterEnv": [
"<rootDir>/test/setupTests.js"
],
Expand Down
103 changes: 73 additions & 30 deletions src/scripts/AutoAlign.js → src/scripts/AutoAlign.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
import React from 'react';
import React, { ComponentType } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import RelativePortal from 'react-relative-portal';
import { ComponentSettingsContext } from './ComponentSettings';

function delay(ms) {
function delay(ms: number) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}

function getViewportRect() {
function getViewportRect(): Rect {
const { innerHeight: height = Infinity, innerWidth: width = Infinity } =
window || {};
return { top: 0, left: 0, width, height };
}

function getCenterPoint(rect) {
type Rect = {
top: number;
left: number;
width: number;
height: number;
};

function getCenterPoint(rect: Rect) {
return {
x: rect.left + 0.5 * rect.width,
y: rect.top + 0.5 * rect.height,
};
}

function getPreferAlignment(rect) {
function getPreferAlignment(rect: Rect) {
const { x: rx, y: ry } = getCenterPoint(rect);
const { x: vx, y: vy } = getCenterPoint(getViewportRect());
return {
Expand All @@ -31,7 +39,12 @@ function getPreferAlignment(rect) {
};
}

function calcAlignmentRect(target, rect, vertAlign, horizAlign) {
function calcAlignmentRect(
target: Rect,
rect: { width: number; height: number },
vertAlign: string,
horizAlign: string
) {
return {
...rect,
top:
Expand All @@ -53,7 +66,7 @@ function calcAlignmentRect(target, rect, vertAlign, horizAlign) {
};
}

function hasViewportIntersection({ top, left, width, height }) {
function hasViewportIntersection({ top, left, width, height }: Rect) {
const { width: viewportWidth, height: viewportHeight } = getViewportRect();
return (
top < 0 ||
Expand All @@ -63,7 +76,7 @@ function hasViewportIntersection({ top, left, width, height }) {
);
}

function isEqualRect(aRect, bRect) {
function isEqualRect(aRect: Rect, bRect: Rect) {
return (
aRect.top === bRect.top &&
aRect.left === bRect.left &&
Expand All @@ -72,9 +85,9 @@ function isEqualRect(aRect, bRect) {
);
}

function throttle(func, ms) {
function throttle(func: Function, ms: number) {
let last = 0;
return (...args) => {
return (...args: any) => {
const now = Date.now();
if (last + ms < now) {
func(...args);
Expand All @@ -83,40 +96,69 @@ function throttle(func, ms) {
};
}

function ignoreFirstCall(func) {
function ignoreFirstCall(func: Function) {
let called = false;
return (...args) => {
return (...args: any) => {
if (called) {
func(...args);
}
called = true;
};
}

export type AutoAlignOptions = {
triggerSelector: string;
};

export type AutoAlignProps = {
portalClassName?: string;
portalStyle?: object;
size?: 'small' | 'medium' | 'large';
preventPortalize?: boolean;
} & Partial<InjectedProps>;

export type InjectedProps = {
align: 'left' | 'right';
vertAlign: 'top' | 'bottom';
};

export type AutoAlignState = {
triggerRect: Rect;
horizAlign: string;
vertAlign: string;
};

/**
*
*/
export default function autoAlign(options) {
export function autoAlign(options: AutoAlignOptions) {
const { triggerSelector } = options;

return (Cmp) =>
class extends React.Component {
static propTypes = {
portalClassName: PropTypes.string,
portalStyle: PropTypes.object, // eslint-disable-line react/forbid-prop-types
size: PropTypes.oneOf(['small', 'medium', 'large']),
align: PropTypes.oneOf(['left', 'right']),
vertAlign: PropTypes.oneOf(['top', 'bottom']),
preventPortalize: PropTypes.bool,
children: PropTypes.node,
};
return <TOriginalProps extends {}>(
Cmp: ComponentType<TOriginalProps & InjectedProps>
) => {
type ResultProps = TOriginalProps & AutoAlignProps;

return class extends React.Component<ResultProps, AutoAlignState> {
private pid: number | null = null;

/* eslint-disable react/sort-comp */
node: any;

content: any;
/* eslint-enable react/sort-comp */

context!: Pick<
ComponentSettingsContext,
'portalClassName' | 'portalStyle'
>;

static contextTypes = {
portalClassName: PropTypes.string,
portalStyle: PropTypes.object, // eslint-disable-line react/forbid-prop-types
};

state = {
state: AutoAlignState = {
triggerRect: { top: 0, left: 0, width: 0, height: 0 },
horizAlign: 'left',
vertAlign: 'top',
Expand Down Expand Up @@ -182,7 +224,7 @@ export default function autoAlign(options) {
}
};

updateAlignment(triggerRect) {
updateAlignment(triggerRect: Rect) {
if (this.content && this.content.node) {
const {
horizAlign: oldHorizAlign,
Expand Down Expand Up @@ -273,10 +315,10 @@ export default function autoAlign(options) {
: 0;
const content = (
<Cmp
align={align.split('-')[0]}
vertAlign={vertAlign.split('-')[0]}
ref={(cmp) => (this.content = cmp)}
{...pprops}
align={align.split('-')[0] as InjectedProps['align']}
vertAlign={vertAlign.split('-')[0] as InjectedProps['vertAlign']}
ref={(cmp: any) => (this.content = cmp)}
{...pprops as TOriginalProps}
>
{children}
</Cmp>
Expand All @@ -301,4 +343,5 @@ export default function autoAlign(options) {
);
}
};
};
}
8 changes: 2 additions & 6 deletions src/scripts/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ import classnames from 'classnames';
export type BadgeProps = {
type?: 'default' | 'shade' | 'inverse';
label?: string;
};
} & HTMLAttributes<HTMLSpanElement>;

export const Badge: React.FC<BadgeProps & HTMLAttributes<HTMLSpanElement>> = ({
type,
label,
...props
}) => {
export const Badge: React.FC<BadgeProps> = ({ type, label, ...props }) => {
const typeClassName = type ? `slds-theme--${type}` : null;
const badgeClassNames = classnames('slds-badge', typeClassName);
return (
Expand Down
15 changes: 9 additions & 6 deletions src/scripts/BreadCrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import classnames from 'classnames';
export type CrumbProps = {
className?: string;
href?: string;
};
} & HTMLAttributes<HTMLLIElement>;

export const Crumb: React.FC<CrumbProps & HTMLAttributes<HTMLLIElement>> = ({
export const Crumb: React.FC<CrumbProps> = ({
className,
href,
children,
Expand All @@ -28,11 +28,14 @@ export const Crumb: React.FC<CrumbProps & HTMLAttributes<HTMLLIElement>> = ({
export type BreadCrumbsProps = {
label?: string;
className?: string;
};
} & HTMLAttributes<HTMLElement>;

export const BreadCrumbs: React.FC<
BreadCrumbsProps & HTMLAttributes<HTMLElement>
> = ({ label, className, children, ...props }) => {
export const BreadCrumbs: React.FC<BreadCrumbsProps> = ({
label,
className,
children,
...props
}) => {
const oClassName = classnames(
'slds-breadcrumb slds-list--horizontal',
className
Expand Down
31 changes: 13 additions & 18 deletions src/scripts/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component, ReactNode, ButtonHTMLAttributes } from 'react';
import classnames from 'classnames';
import Icon from './Icon';
import Spinner from './Spinner';
import { Icon } from './Icon';
import { Spinner } from './Spinner';

type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

Expand All @@ -16,7 +16,8 @@ export type ButtonType =
| 'icon-inverse'
| 'icon-more'
| 'icon-border'
| 'icon-border-filled';
| 'icon-border-filled'
| 'icon-border-inverse';

const ICON_SIZES = ['x-small', 'small', 'medium', 'large'] as const;
const ICON_ALIGNS = ['left', 'right'] as const;
Expand All @@ -42,21 +43,15 @@ export type ButtonProps = {
iconMore?: string;
iconMoreSize?: ButtonIconMoreSize;
onClick?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
buttonRef?: (node?: HTMLButtonElement) => void;
};
buttonRef?: (node: HTMLButtonElement) => void;
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'>;

export class Button extends Component<
ButtonProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'>,
{}
> {
// eslint-disable-next-line react/sort-comp
private node: HTMLButtonElement | null;
export class Button extends Component<ButtonProps, {}> {
node: HTMLButtonElement | null = null;

constructor(props: Readonly<ButtonProps>) {
super(props);

this.node = null;

this.onClick = this.onClick.bind(this);
}

Expand All @@ -74,7 +69,7 @@ export class Button extends Component<
const inverse = inv || /-?inverse$/.test(type || '');
return (
<ButtonIcon
icon={icon}
icon={icon!}
align={iconAlign}
size={iconSize}
inverse={inverse}
Expand All @@ -87,7 +82,7 @@ export class Button extends Component<
const adjoining = icon && (iconAlign === 'right' || !(label || children));
const iconMoreSize =
this.props.iconMoreSize || adjoining ? 'x-small' : 'small';
return <ButtonIcon icon={iconMore} align='right' size={iconMoreSize} />;
return <ButtonIcon icon={iconMore!} align='right' size={iconMoreSize} />;
}

render() {
Expand Down Expand Up @@ -146,7 +141,7 @@ export class Button extends Component<

export type ButtonIconProps = {
className?: string;
icon?: string;
icon: string;
align?: ButtonIconAlign;
size?: ButtonIconSize;
inverse?: boolean;
Expand Down Expand Up @@ -176,13 +171,13 @@ export const ButtonIcon: React.FC<ButtonIconProps> = ({
inverseClassName,
className
);
const iconStyle = { ...style, pointerEvents: 'none' };
return (
<Icon
className={iconClassNames}
icon={icon}
textColor={null}
style={iconStyle}
pointerEvents='none'
style={style}
{...props}
/>
);
Expand Down
Loading