@bundle-stats/ui 4.13.0-beta.2 → 4.13.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/app.js +4 -8
- package/lib/app/app.js.map +1 -1
- package/lib/app/app.module.css +2 -2
- package/lib/assets/icons.svg +70 -67
- package/lib/assets/icons.svg.js +14 -12
- package/lib/assets/icons.svg.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.js +47 -8
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.module.css +0 -5
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js +25 -14
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.i18n.js +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +45 -14
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.module.css +0 -5
- package/lib/components/bundle-packages/bundle-packages.js +45 -6
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.module.css +0 -5
- package/lib/components/delta/delta.js +1 -1
- package/lib/components/delta/delta.js.map +1 -1
- package/lib/components/delta/delta.module.css +10 -1
- package/lib/components/index.js +1 -3
- package/lib/components/index.js.map +1 -1
- package/lib/components/jobs-header/jobs-header.module.css +0 -4
- package/lib/components/metrics-display-selector/metrics-display-selector.js +42 -5
- package/lib/components/metrics-display-selector/metrics-display-selector.js.map +1 -1
- package/lib/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
- package/lib/components/metrics-table/metrics-table.i18n.js +1 -6
- package/lib/components/metrics-table/metrics-table.i18n.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.js +4 -37
- package/lib/components/metrics-table/metrics-table.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.module.css +1 -44
- package/lib/components/{total-size-type-title → metrics-table-header}/index.js +1 -1
- package/lib/components/metrics-table-header/index.js.map +1 -0
- package/lib/components/metrics-table-header/metrics-table-header.i18n.js +9 -0
- package/lib/components/metrics-table-header/metrics-table-header.i18n.js.map +1 -0
- package/lib/components/metrics-table-header/metrics-table-header.js +79 -0
- package/lib/components/metrics-table-header/metrics-table-header.js.map +1 -0
- package/lib/components/metrics-table-header/metrics-table-header.module.css +51 -0
- package/lib/components/metrics-table-options/metrics-table-options.js +2 -2
- package/lib/components/metrics-table-options/metrics-table-options.js.map +1 -1
- package/lib/components/metrics-table-title/metrics-table-title.js +1 -1
- package/lib/components/metrics-table-title/metrics-table-title.js.map +1 -1
- package/lib/components/metrics-table-title/metrics-table-title.module.css +4 -4
- package/lib/components/metrics-treemap/index.js +4 -0
- package/lib/components/metrics-treemap/index.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.constants.js +3 -0
- package/lib/components/metrics-treemap/metrics-treemap.constants.js.map +1 -0
- package/lib/components/metrics-treemap/metrics-treemap.i18n.js +6 -0
- package/lib/components/metrics-treemap/metrics-treemap.i18n.js.map +1 -0
- package/lib/components/metrics-treemap/metrics-treemap.js +96 -70
- package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.module.css +163 -51
- package/lib/components/metrics-treemap/metrics-treemap.utils.js +109 -0
- package/lib/components/metrics-treemap/metrics-treemap.utils.js.map +1 -0
- package/lib/components/module-info/module-info.js +1 -2
- package/lib/components/module-info/module-info.js.map +1 -1
- package/lib/components/run-info/run-info.module.css +7 -7
- package/lib/components/sort-button/sort-button.module.css +1 -0
- package/lib/css/variables.css +14 -13
- package/lib/hooks/metrics-display-type.js +45 -24
- package/lib/hooks/metrics-display-type.js.map +1 -1
- package/lib/hooks/search-params.js +1 -0
- package/lib/hooks/search-params.js.map +1 -1
- package/lib/layout/box/box.module.css +4 -2
- package/lib/layout/flex-stack/flex-stack.js +3 -4
- package/lib/layout/flex-stack/flex-stack.js.map +1 -1
- package/lib/layout/flex-stack/flex-stack.module.css +19 -23
- package/lib/ui/button/button.js +5 -4
- package/lib/ui/button/button.js.map +1 -1
- package/lib/ui/button/button.module.css +55 -53
- package/lib/ui/dropdown/dropdown.js +10 -40
- package/lib/ui/dropdown/dropdown.js.map +1 -1
- package/lib/ui/dropdown/index.js.map +1 -1
- package/lib/ui/filters/filters.js +33 -35
- package/lib/ui/filters/filters.js.map +1 -1
- package/lib/ui/filters/filters.module.css +55 -67
- package/lib/ui/hover-card/hover-card.js +1 -1
- package/lib/ui/hover-card/hover-card.js.map +1 -1
- package/lib/ui/icon/icon.js +2 -1
- package/lib/ui/icon/icon.js.map +1 -1
- package/lib/ui/input-search/input-search.js +1 -1
- package/lib/ui/input-search/input-search.js.map +1 -1
- package/lib/ui/loader/loader.js +1 -1
- package/lib/ui/loader/loader.js.map +1 -1
- package/lib/ui/table/table.module.css +30 -0
- package/lib/ui/tag/tag.module.css +3 -3
- package/lib/ui/toolbar/toolbar.module.css +1 -3
- package/lib-esm/app/app.js +4 -8
- package/lib-esm/app/app.js.map +1 -1
- package/lib-esm/app/app.module.css +2 -2
- package/lib-esm/assets/icons.svg +70 -67
- package/lib-esm/assets/icons.svg.js +14 -12
- package/lib-esm/assets/icons.svg.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +48 -9
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +0 -5
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js +26 -15
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.i18n.js +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js +46 -15
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.module.css +0 -5
- package/lib-esm/components/bundle-packages/bundle-packages.js +46 -7
- package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +0 -5
- package/lib-esm/components/delta/delta.js +1 -1
- package/lib-esm/components/delta/delta.js.map +1 -1
- package/lib-esm/components/delta/delta.module.css +10 -1
- package/lib-esm/components/index.js +0 -1
- package/lib-esm/components/index.js.map +1 -1
- package/lib-esm/components/jobs-header/jobs-header.module.css +0 -4
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.js +42 -5
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.js.map +1 -1
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
- package/lib-esm/components/metrics-table/metrics-table.i18n.js +0 -5
- package/lib-esm/components/metrics-table/metrics-table.i18n.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.js +4 -37
- package/lib-esm/components/metrics-table/metrics-table.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.module.css +1 -44
- package/lib-esm/components/metrics-table-header/index.js +2 -0
- package/lib-esm/components/metrics-table-header/index.js.map +1 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.i18n.js +6 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.i18n.js.map +1 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.js +49 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.js.map +1 -0
- package/lib-esm/components/metrics-table-header/metrics-table-header.module.css +51 -0
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +3 -3
- package/lib-esm/components/metrics-table-options/metrics-table-options.js.map +1 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +1 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.js.map +1 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.module.css +4 -4
- package/lib-esm/components/metrics-treemap/index.js +1 -0
- package/lib-esm/components/metrics-treemap/index.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js +2 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js.map +1 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.i18n.js +3 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.i18n.js.map +1 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.js +98 -71
- package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +163 -51
- package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js +105 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js.map +1 -0
- package/lib-esm/components/module-info/module-info.js +1 -2
- package/lib-esm/components/module-info/module-info.js.map +1 -1
- package/lib-esm/components/run-info/run-info.module.css +7 -7
- package/lib-esm/components/sort-button/sort-button.module.css +1 -0
- package/lib-esm/css/variables.css +14 -13
- package/lib-esm/hooks/metrics-display-type.js +46 -24
- package/lib-esm/hooks/metrics-display-type.js.map +1 -1
- package/lib-esm/hooks/search-params.js +1 -0
- package/lib-esm/hooks/search-params.js.map +1 -1
- package/lib-esm/layout/box/box.module.css +4 -2
- package/lib-esm/layout/flex-stack/flex-stack.js +3 -4
- package/lib-esm/layout/flex-stack/flex-stack.js.map +1 -1
- package/lib-esm/layout/flex-stack/flex-stack.module.css +19 -23
- package/lib-esm/ui/button/button.js +5 -4
- package/lib-esm/ui/button/button.js.map +1 -1
- package/lib-esm/ui/button/button.module.css +55 -53
- package/lib-esm/ui/dropdown/dropdown.js +8 -39
- package/lib-esm/ui/dropdown/dropdown.js.map +1 -1
- package/lib-esm/ui/dropdown/index.js.map +1 -1
- package/lib-esm/ui/filters/filters.js +34 -36
- package/lib-esm/ui/filters/filters.js.map +1 -1
- package/lib-esm/ui/filters/filters.module.css +55 -67
- package/lib-esm/ui/hover-card/hover-card.js +1 -1
- package/lib-esm/ui/hover-card/hover-card.js.map +1 -1
- package/lib-esm/ui/icon/icon.js +2 -1
- package/lib-esm/ui/icon/icon.js.map +1 -1
- package/lib-esm/ui/input-search/input-search.js +1 -1
- package/lib-esm/ui/input-search/input-search.js.map +1 -1
- package/lib-esm/ui/loader/loader.js +1 -1
- package/lib-esm/ui/loader/loader.js.map +1 -1
- package/lib-esm/ui/table/table.module.css +30 -0
- package/lib-esm/ui/tag/tag.module.css +3 -3
- package/lib-esm/ui/toolbar/toolbar.module.css +1 -3
- package/package.json +10 -10
- package/src/app/app.jsx +4 -12
- package/src/app/app.module.css +2 -2
- package/src/assets/icons/check.svg +4 -0
- package/src/assets/icons.svg +70 -67
- package/src/assets/icons.svg.jsx +12 -12
- package/src/components/bundle-assets/bundle-assets.jsx +85 -12
- package/src/components/bundle-assets/bundle-assets.module.css +0 -5
- package/src/components/bundle-assets-totals/bundle-assets-totals.jsx +71 -35
- package/src/components/bundle-modules/bundle-modules.i18n.ts +1 -1
- package/src/components/bundle-modules/bundle-modules.module.css +0 -5
- package/src/components/bundle-modules/bundle-modules.tsx +123 -45
- package/src/components/bundle-packages/bundle-packages.jsx +79 -10
- package/src/components/bundle-packages/bundle-packages.module.css +0 -5
- package/src/components/delta/delta.jsx +1 -1
- package/src/components/delta/delta.module.css +10 -1
- package/src/components/index.js +0 -1
- package/src/components/jobs-header/jobs-header.module.css +0 -4
- package/src/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
- package/src/components/metrics-display-selector/metrics-display-selector.stories.tsx +33 -0
- package/src/components/metrics-display-selector/metrics-display-selector.tsx +86 -28
- package/src/components/metrics-table/metrics-table.i18n.ts +0 -7
- package/src/components/metrics-table/metrics-table.module.css +1 -44
- package/src/components/metrics-table/metrics-table.tsx +17 -153
- package/src/components/metrics-table-header/index.ts +1 -0
- package/src/components/metrics-table-header/metrics-table-header.i18n.ts +6 -0
- package/src/components/metrics-table-header/metrics-table-header.module.css +51 -0
- package/src/components/metrics-table-header/metrics-table-header.tsx +172 -0
- package/src/components/metrics-table-options/metrics-table-options.jsx +4 -10
- package/src/components/metrics-table-title/metrics-table-title.jsx +1 -1
- package/src/components/metrics-table-title/metrics-table-title.module.css +4 -4
- package/src/components/metrics-treemap/__tests__/metrics-treemap.utils.ts +188 -0
- package/src/components/metrics-treemap/index.ts +1 -0
- package/src/components/metrics-treemap/metrics-treemap.constants.ts +52 -0
- package/src/components/metrics-treemap/metrics-treemap.i18n.ts +2 -0
- package/src/components/metrics-treemap/metrics-treemap.module.css +163 -51
- package/src/components/metrics-treemap/metrics-treemap.stories.tsx +44 -10
- package/src/components/metrics-treemap/metrics-treemap.tsx +340 -142
- package/src/components/metrics-treemap/metrics-treemap.utils.ts +162 -0
- package/src/components/module-info/module-info.tsx +1 -1
- package/src/components/run-info/run-info.module.css +7 -7
- package/src/components/sort-button/sort-button.module.css +1 -0
- package/src/css/variables.css +14 -13
- package/src/hooks/metrics-display-type.ts +79 -29
- package/src/hooks/search-params.js +1 -0
- package/src/layout/box/box.module.css +4 -2
- package/src/layout/flex-stack/flex-stack.module.css +19 -23
- package/src/layout/flex-stack/flex-stack.tsx +2 -8
- package/src/ui/button/button.module.css +55 -53
- package/src/ui/button/button.stories.tsx +16 -9
- package/src/ui/button/button.tsx +8 -7
- package/src/ui/dropdown/dropdown.stories.tsx +25 -0
- package/src/ui/dropdown/dropdown.tsx +66 -0
- package/src/ui/filters/filters.module.css +55 -67
- package/src/ui/filters/filters.stories.tsx +109 -0
- package/src/ui/filters/filters.tsx +128 -167
- package/src/ui/hover-card/hover-card.tsx +1 -1
- package/src/ui/icon/icon.tsx +2 -1
- package/src/ui/input-search/input-search.tsx +1 -0
- package/src/ui/loader/loader.jsx +1 -1
- package/src/ui/table/table.module.css +30 -0
- package/src/ui/tag/tag.module.css +3 -3
- package/src/ui/toolbar/toolbar.module.css +1 -3
- package/types/components/bundle-assets-totals/bundle-assets-totals.d.ts +5 -1
- package/types/components/bundle-modules/bundle-modules.i18n.d.ts +1 -1
- package/types/components/delta/delta.d.ts +2 -2
- package/types/components/index.d.ts +0 -1
- package/types/components/metrics-display-selector/metrics-display-selector.d.ts +5 -3
- package/types/components/metrics-table/metrics-table.d.ts +4 -10
- package/types/components/metrics-table/metrics-table.i18n.d.ts +0 -5
- package/types/components/metrics-table-header/index.d.ts +1 -0
- package/types/components/metrics-table-header/metrics-table-header.d.ts +15 -0
- package/types/components/metrics-table-header/metrics-table-header.i18n.d.ts +5 -0
- package/types/components/metrics-treemap/index.d.ts +1 -0
- package/types/components/metrics-treemap/metrics-treemap.constants.d.ts +20 -0
- package/types/components/metrics-treemap/metrics-treemap.d.ts +7 -5
- package/types/components/metrics-treemap/metrics-treemap.i18n.d.ts +2 -0
- package/types/components/metrics-treemap/metrics-treemap.utils.d.ts +5 -0
- package/types/hooks/metrics-display-type.d.ts +8 -2
- package/types/ui/dropdown/dropdown.d.ts +12 -47
- package/types/ui/dropdown/index.d.ts +1 -1
- package/types/ui/filters/filters.d.ts +2 -7
- package/types/ui/icon/icon.d.ts +4 -2
- package/types/ui/loader/loader.d.ts +2 -2
- package/lib/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
- package/lib/components/total-size-type-title/index.js.map +0 -1
- package/lib/components/total-size-type-title/total-size-type-title.js +0 -32
- package/lib/components/total-size-type-title/total-size-type-title.js.map +0 -1
- package/lib/components/total-size-type-title/total-size-type-title.module.css +0 -14
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
- package/lib-esm/components/total-size-type-title/index.js +0 -2
- package/lib-esm/components/total-size-type-title/index.js.map +0 -1
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +0 -25
- package/lib-esm/components/total-size-type-title/total-size-type-title.js.map +0 -1
- package/lib-esm/components/total-size-type-title/total-size-type-title.module.css +0 -14
- package/src/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
- package/src/components/total-size-type-title/index.js +0 -1
- package/src/components/total-size-type-title/total-size-type-title.jsx +0 -41
- package/src/components/total-size-type-title/total-size-type-title.module.css +0 -14
- package/src/ui/dropdown/dropdown.jsx +0 -88
- package/types/components/total-size-type-title/index.d.ts +0 -1
- package/types/components/total-size-type-title/total-size-type-title.d.ts +0 -14
- /package/src/ui/dropdown/{index.js → index.ts} +0 -0
|
@@ -62,7 +62,14 @@ export const All = () => (
|
|
|
62
62
|
<h3>With icon</h3>
|
|
63
63
|
<Items>
|
|
64
64
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
65
|
-
<Button glyph={Icon.ICONS.
|
|
65
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} kind={kind} key={kind}>
|
|
66
|
+
Action {kind}
|
|
67
|
+
</Button>
|
|
68
|
+
))}
|
|
69
|
+
</Items>
|
|
70
|
+
<Items>
|
|
71
|
+
{Object.values(BUTTON_KIND).map((kind) => (
|
|
72
|
+
<Button rightGlyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} kind={kind} key={kind}>
|
|
66
73
|
Action {kind}
|
|
67
74
|
</Button>
|
|
68
75
|
))}
|
|
@@ -106,12 +113,12 @@ export const All = () => (
|
|
|
106
113
|
<h3>With icon</h3>
|
|
107
114
|
{Object.values(BUTTON_SIZE).map((size) => (
|
|
108
115
|
<Items key={size}>
|
|
109
|
-
<Button glyph={Icon.ICONS.
|
|
116
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} outline size={size}>
|
|
110
117
|
Action default
|
|
111
118
|
</Button>
|
|
112
119
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
113
120
|
<Button
|
|
114
|
-
glyph={Icon.ICONS.
|
|
121
|
+
glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
|
|
115
122
|
outline
|
|
116
123
|
kind={kind}
|
|
117
124
|
size={size}
|
|
@@ -125,10 +132,10 @@ export const All = () => (
|
|
|
125
132
|
<h3>Only icon</h3>
|
|
126
133
|
{Object.values(BUTTON_SIZE).map((size) => (
|
|
127
134
|
<Items key={size}>
|
|
128
|
-
<Button glyph={Icon.ICONS.
|
|
135
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} outline size={size} />
|
|
129
136
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
130
137
|
<Button
|
|
131
|
-
glyph={Icon.ICONS.
|
|
138
|
+
glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
|
|
132
139
|
outline
|
|
133
140
|
kind={kind}
|
|
134
141
|
size={size}
|
|
@@ -179,12 +186,12 @@ export const All = () => (
|
|
|
179
186
|
<h3>With icon</h3>
|
|
180
187
|
{Object.values(BUTTON_SIZE).map((size) => (
|
|
181
188
|
<Items key={size}>
|
|
182
|
-
<Button glyph={Icon.ICONS.
|
|
189
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} solid size={size}>
|
|
183
190
|
Action default
|
|
184
191
|
</Button>
|
|
185
192
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
186
193
|
<Button
|
|
187
|
-
glyph={Icon.ICONS.
|
|
194
|
+
glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
|
|
188
195
|
solid
|
|
189
196
|
kind={kind}
|
|
190
197
|
size={size}
|
|
@@ -198,10 +205,10 @@ export const All = () => (
|
|
|
198
205
|
<h3>Only icon</h3>
|
|
199
206
|
{Object.values(BUTTON_SIZE).map((size) => (
|
|
200
207
|
<Items key={size}>
|
|
201
|
-
<Button glyph={Icon.ICONS.
|
|
208
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} solid size={size} />
|
|
202
209
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
203
210
|
<Button
|
|
204
|
-
glyph={Icon.ICONS.
|
|
211
|
+
glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
|
|
205
212
|
solid
|
|
206
213
|
kind={kind}
|
|
207
214
|
size={size}
|
package/src/ui/button/button.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import { Button as ButtonBaseComponent } from 'ariakit/button';
|
|
4
5
|
|
|
@@ -50,7 +51,7 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
|
|
|
50
51
|
radius = '',
|
|
51
52
|
padding = '',
|
|
52
53
|
as: Component = ButtonBaseComponent,
|
|
53
|
-
children,
|
|
54
|
+
children = null,
|
|
54
55
|
Icon = BaseIcon,
|
|
55
56
|
glyph,
|
|
56
57
|
rightGlyph,
|
|
@@ -61,10 +62,12 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
|
|
|
61
62
|
const resolvedPadding = padding || ((outline || solid) && size);
|
|
62
63
|
const resolvedRadius = radius || ((outline || solid) && size);
|
|
63
64
|
|
|
65
|
+
const resolvedSize = Object.values(BUTTON_SIZE).includes(size) ? size : BUTTON_SIZE.MEDIUM;
|
|
66
|
+
|
|
64
67
|
const rootClassName = cx(
|
|
65
68
|
css.root,
|
|
66
|
-
css[size],
|
|
67
69
|
kind && css[kind],
|
|
70
|
+
css[resolvedSize],
|
|
68
71
|
|
|
69
72
|
outline && css.outline,
|
|
70
73
|
outline && css[`outline--${kind}`],
|
|
@@ -72,22 +75,20 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
|
|
|
72
75
|
solid && css.solid,
|
|
73
76
|
solid && css[`solid--${kind}`],
|
|
74
77
|
|
|
75
|
-
resolvedPadding && css
|
|
76
|
-
resolvedPadding && outline && css[`outline--padding--${resolvedPadding}`],
|
|
78
|
+
resolvedPadding && css.padding,
|
|
77
79
|
resolvedRadius && css[`radius--${resolvedRadius}`],
|
|
78
80
|
|
|
79
81
|
active && css.active,
|
|
80
82
|
active && outline && css[`active-outline-${kind}`],
|
|
81
83
|
|
|
82
|
-
css[size],
|
|
83
84
|
className,
|
|
84
85
|
);
|
|
85
86
|
|
|
86
87
|
return (
|
|
87
88
|
<Component {...restProps} className={rootClassName}>
|
|
88
|
-
{glyph && <Icon glyph={glyph}
|
|
89
|
+
{glyph && <Icon glyph={glyph} className={css.glyph} />}
|
|
89
90
|
{children && <span className={css.content}>{children}</span>}
|
|
90
|
-
{rightGlyph && <Icon glyph={
|
|
91
|
+
{rightGlyph && <Icon glyph={rightGlyph} className={css.glyph} />}
|
|
91
92
|
</Component>
|
|
92
93
|
);
|
|
93
94
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { getWrapperDecorator } from '../../stories';
|
|
5
|
+
import { Dropdown, DropdownItem } from '.';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'UI/Dropdown',
|
|
9
|
+
component: Dropdown,
|
|
10
|
+
decorators: [getWrapperDecorator()],
|
|
11
|
+
} as Meta;
|
|
12
|
+
|
|
13
|
+
export const Defualt = () => (
|
|
14
|
+
<Dropdown glyph="filter" label="Toggle">
|
|
15
|
+
<DropdownItem>Option 1</DropdownItem>
|
|
16
|
+
<DropdownItem>Option 2</DropdownItem>
|
|
17
|
+
</Dropdown>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const Disabled = () => (
|
|
21
|
+
<Dropdown glyph="filter" label="Toggle" disabled>
|
|
22
|
+
<DropdownItem>Option 1</DropdownItem>
|
|
23
|
+
<DropdownItem>Option 2</DropdownItem>
|
|
24
|
+
</Dropdown>
|
|
25
|
+
);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Menu, MenuButton, MenuItem, useMenuState } from 'ariakit/menu';
|
|
4
|
+
|
|
5
|
+
import { Button, BUTTON_SIZE } from '../button';
|
|
6
|
+
import css from './dropdown.module.css';
|
|
7
|
+
|
|
8
|
+
interface DropdownItemProps {
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const DropdownItem = (props: DropdownItemProps & React.ComponentProps<typeof MenuItem>) => {
|
|
13
|
+
const { className = '', isActive = false, ...restProps } = props;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<MenuItem className={cx(css.item, className, isActive && css.itemActive)} {...restProps} />
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
interface DropdownProps {
|
|
21
|
+
dropdownClassName?: string;
|
|
22
|
+
label?: React.ReactNode;
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
glyph?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Dropdown = (props: DropdownProps & React.ComponentProps<'div'>) => {
|
|
29
|
+
const {
|
|
30
|
+
className = '',
|
|
31
|
+
dropdownClassName = '',
|
|
32
|
+
label = null,
|
|
33
|
+
ariaLabel = '',
|
|
34
|
+
glyph = '',
|
|
35
|
+
disabled = false,
|
|
36
|
+
children,
|
|
37
|
+
} = props;
|
|
38
|
+
|
|
39
|
+
const dropdownAriaLabel = ariaLabel || (typeof label === 'string' ? label : '');
|
|
40
|
+
const menuState = useMenuState();
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<MenuButton
|
|
45
|
+
as={Button}
|
|
46
|
+
outline
|
|
47
|
+
size={BUTTON_SIZE.SMALL}
|
|
48
|
+
glyph={glyph}
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
state={menuState}
|
|
51
|
+
tabIndex={null}
|
|
52
|
+
className={cx(css.button, className)}
|
|
53
|
+
>
|
|
54
|
+
{label}
|
|
55
|
+
</MenuButton>
|
|
56
|
+
<Menu
|
|
57
|
+
portal
|
|
58
|
+
state={menuState}
|
|
59
|
+
aria-label={dropdownAriaLabel}
|
|
60
|
+
className={cx(css.dropdown, dropdownClassName)}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</Menu>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
/*
|
|
2
|
-
.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* explicit ControlGroup last item styles to override ariakit injected sibling nodes */
|
|
2
|
+
.itemLast {
|
|
3
|
+
border-top-right-radius: var(--radius-small) !important;
|
|
4
|
+
border-bottom-right-radius: var(--radius-small) !important;
|
|
5
|
+
}
|
|
6
6
|
|
|
7
|
+
/* Filter (label with input + text) */
|
|
8
|
+
.filter {
|
|
7
9
|
position: relative;
|
|
8
10
|
width: 100%;
|
|
9
11
|
max-width: 240px;
|
|
12
|
+
color: var(--color-text);
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.filterInput {
|
|
15
|
+
.filterControl {
|
|
16
|
+
margin: 0;
|
|
16
17
|
flex: 0 0 auto;
|
|
17
18
|
height: 1em;
|
|
18
19
|
}
|
|
@@ -25,7 +26,47 @@
|
|
|
25
26
|
text-overflow: ellipsis;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
.
|
|
29
|
+
.filterControl[disabled] + .filterLabel {
|
|
30
|
+
color: var(--color-text-light);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.filter:hover {
|
|
34
|
+
color: var(--color-dark);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Filter single */
|
|
38
|
+
.filterSingle {
|
|
39
|
+
padding: calc(var(--space-xxsmall) - 1px);
|
|
40
|
+
border: 1px solid var(--color-outline);
|
|
41
|
+
border-radius: var(--radius-small);
|
|
42
|
+
font-size: var(--size-small);
|
|
43
|
+
line-height: var(--space-small);
|
|
44
|
+
color: var(--color-text-ultra-light);
|
|
45
|
+
transition: var(--transition-out);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.filterSingle:hover,
|
|
49
|
+
.filterSingle:active,
|
|
50
|
+
.filterSingle:focus {
|
|
51
|
+
border-color: var(--color-outline-dark);
|
|
52
|
+
transition: var(--transition-in);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Filter group */
|
|
56
|
+
.filterGroupItems {
|
|
57
|
+
max-height: calc(10 * (var(--space-small) + 2 * var(--space-xxxsmall)));
|
|
58
|
+
overflow: auto;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.filterGroupItem {
|
|
62
|
+
position: relative;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.filterGroupItemFilter {
|
|
66
|
+
padding-right: 24px; /* space for only button */
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.filterGroupOnlyButton {
|
|
29
70
|
display: none;
|
|
30
71
|
position: absolute;
|
|
31
72
|
right: 2px;
|
|
@@ -37,10 +78,11 @@
|
|
|
37
78
|
}
|
|
38
79
|
|
|
39
80
|
/** cover item text */
|
|
40
|
-
.
|
|
81
|
+
.filterGroupOnlyButton::before {
|
|
41
82
|
content: ' ';
|
|
42
83
|
display: block;
|
|
43
84
|
position: absolute;
|
|
85
|
+
pointer-events: none;
|
|
44
86
|
top: 0;
|
|
45
87
|
right: 100%;
|
|
46
88
|
bottom: 0;
|
|
@@ -48,53 +90,13 @@
|
|
|
48
90
|
background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--color-highlight) 75%);
|
|
49
91
|
}
|
|
50
92
|
|
|
51
|
-
/** filter disabled state */
|
|
52
|
-
.filterInput[disabled] + .filterLabel {
|
|
53
|
-
color: var(--color-text-light);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.filterInput[disabled] + .filterOnlyButton {
|
|
57
|
-
display: none;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
93
|
/** filter hover state */
|
|
61
|
-
.
|
|
62
|
-
color: var(--color-text);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.filter:hover {
|
|
66
|
-
color: var(--color-dark);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.filter:hover .filterOnlyButton {
|
|
94
|
+
.filterGroupItem:hover .filterGroupOnlyButton {
|
|
70
95
|
display: block;
|
|
71
96
|
}
|
|
72
97
|
|
|
73
|
-
/** Filter standard variation */
|
|
74
|
-
.filterStandalone {
|
|
75
|
-
padding: 0;
|
|
76
|
-
width: auto;
|
|
77
|
-
color: var(--color-text-light);
|
|
78
|
-
z-index: var(--layout-xlow); /* show collapsed border */
|
|
79
|
-
font-size: var(--size-small);
|
|
80
|
-
line-height: var(--space-small);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.filterStandalone .filterCheckbox {
|
|
84
|
-
padding: calc(var(--space-xxsmall) - 1px) calc(var(--space-xxsmall) - 1px);
|
|
85
|
-
border: 1px solid var(--color-outline);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.filterStandalone:hover .filterCheckbox,
|
|
89
|
-
.filterStandalone:active .filterCheckbox,
|
|
90
|
-
.filterStandalone:focus .filterCheckbox {
|
|
91
|
-
z-index: var(--layout-xlow); /* show collapsed border */
|
|
92
|
-
box-shadow: var(--outline-hover);
|
|
93
|
-
color: var(--color-text);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
98
|
/** Filter group variation */
|
|
97
|
-
.
|
|
99
|
+
.filterGroupLabelSuffixCustom {
|
|
98
100
|
color: var(--color-text);
|
|
99
101
|
text-transform: lowercase;
|
|
100
102
|
}
|
|
@@ -112,11 +114,6 @@
|
|
|
112
114
|
color: var(--color-text-light);
|
|
113
115
|
}
|
|
114
116
|
|
|
115
|
-
.filterGroupItems {
|
|
116
|
-
max-height: calc(10 * (var(--space-small) + 2 * var(--space-xxxsmall)));
|
|
117
|
-
overflow: auto;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
117
|
.filterGroupActions {
|
|
121
118
|
margin-top: var(--space-xxxsmall);
|
|
122
119
|
padding-top: var(--space-xxxsmall);
|
|
@@ -124,12 +121,3 @@
|
|
|
124
121
|
margin-bottom: calc(0px - var(--space-xxxsmall));
|
|
125
122
|
border-top: 1px solid var(--color-outline);
|
|
126
123
|
}
|
|
127
|
-
|
|
128
|
-
.item {
|
|
129
|
-
position: relative;
|
|
130
|
-
flex: 0 0 auto;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.itemButton {
|
|
134
|
-
border-radius: var(--radius-small);
|
|
135
|
-
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react';
|
|
3
|
+
import { action } from '@storybook/addon-actions'; // eslint-disable-line
|
|
4
|
+
|
|
5
|
+
import { getWrapperDecorator } from '../../stories';
|
|
6
|
+
import { Filters } from '.';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'UI/Filters',
|
|
10
|
+
component: Filters,
|
|
11
|
+
decorators: [getWrapperDecorator({ paddingLeft: '200px' })],
|
|
12
|
+
} as Meta;
|
|
13
|
+
|
|
14
|
+
export const Default = () => (
|
|
15
|
+
<Filters
|
|
16
|
+
onChange={action('CHANGE')}
|
|
17
|
+
filters={{
|
|
18
|
+
changed: {
|
|
19
|
+
label: 'Changed',
|
|
20
|
+
defaultValue: true,
|
|
21
|
+
},
|
|
22
|
+
fileTypes: {
|
|
23
|
+
label: 'File types',
|
|
24
|
+
children: [
|
|
25
|
+
{
|
|
26
|
+
key: 'CSS',
|
|
27
|
+
label: 'CSS',
|
|
28
|
+
defaultValue: true,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'JS',
|
|
32
|
+
label: 'JS',
|
|
33
|
+
defaultValue: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 'HTML',
|
|
37
|
+
label: 'HTML',
|
|
38
|
+
defaultValue: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: 'OTHER',
|
|
42
|
+
label: 'Asset that is not CSS, JS or HTML',
|
|
43
|
+
defaultValue: true,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export const Overflow = () => (
|
|
52
|
+
<Filters
|
|
53
|
+
onChange={action('CHANGE')}
|
|
54
|
+
filters={{
|
|
55
|
+
changed: {
|
|
56
|
+
label: 'Changed',
|
|
57
|
+
defaultValue: true,
|
|
58
|
+
},
|
|
59
|
+
chunks: {
|
|
60
|
+
label: 'Chunks',
|
|
61
|
+
children: Array(22)
|
|
62
|
+
.fill('')
|
|
63
|
+
.map((_, currentIndex) => ({
|
|
64
|
+
key: `chunk-${currentIndex}`,
|
|
65
|
+
label: `Chunk ${currentIndex + 1}`,
|
|
66
|
+
defaultValue: true,
|
|
67
|
+
})),
|
|
68
|
+
},
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
export const DisableOptions = () => (
|
|
74
|
+
<Filters
|
|
75
|
+
onChange={action('CHANGE')}
|
|
76
|
+
filters={{
|
|
77
|
+
changed: {
|
|
78
|
+
label: 'Changed',
|
|
79
|
+
defaultValue: false,
|
|
80
|
+
disabled: true,
|
|
81
|
+
},
|
|
82
|
+
entrypoint: {
|
|
83
|
+
label: 'Entrypoint',
|
|
84
|
+
defaultValue: false,
|
|
85
|
+
},
|
|
86
|
+
fileTypes: {
|
|
87
|
+
label: 'File types',
|
|
88
|
+
children: [
|
|
89
|
+
{
|
|
90
|
+
key: 'CSS',
|
|
91
|
+
label: 'CSS',
|
|
92
|
+
defaultValue: true,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'JS',
|
|
96
|
+
label: 'JS',
|
|
97
|
+
defaultValue: true,
|
|
98
|
+
disabled: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: 'HTML',
|
|
102
|
+
label: 'HTML',
|
|
103
|
+
defaultValue: true,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
);
|