@duro-app/ui 0.15.0 → 0.15.1
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/dist/components/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/components/ActionBar/ActionBar.stories.d.ts.map +1 -1
- package/dist/components/Button/styles.css.d.ts +1 -0
- package/dist/components/Button/styles.css.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -23
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/ActionBar/ActionBar.stories.tsx +4 -13
- package/src/components/ActionBar/ActionBar.tsx +10 -20
- package/src/components/Button/styles.css.ts +1 -0
- package/src/components/Select/Select.tsx +7 -1
- package/src/components/Table/Table.tsx +7 -1
- package/src/index.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duro-app/ui",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"react-strict-dom": "^0.0.55"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@duro-app/tokens": "^0.15.
|
|
41
|
+
"@duro-app/tokens": "^0.15.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@babel/preset-typescript": "^7.28.0",
|
|
@@ -113,10 +113,7 @@ function SelectableTable({
|
|
|
113
113
|
))}
|
|
114
114
|
</Table.Body>
|
|
115
115
|
</Table.Root>
|
|
116
|
-
<ActionBar
|
|
117
|
-
selectedItemCount={selected.size}
|
|
118
|
-
onClearSelection={clearSelection}
|
|
119
|
-
>
|
|
116
|
+
<ActionBar selectedItemCount={selected.size} onClearSelection={clearSelection}>
|
|
120
117
|
<Button variant="secondary" size="small">
|
|
121
118
|
Export
|
|
122
119
|
</Button>
|
|
@@ -148,9 +145,7 @@ export const Default: Story = {
|
|
|
148
145
|
}
|
|
149
146
|
|
|
150
147
|
export const MultipleSelected: Story = {
|
|
151
|
-
render: () => (
|
|
152
|
-
<SelectableTable initialSelected={new Set(['1', '3', '4'])} />
|
|
153
|
-
),
|
|
148
|
+
render: () => <SelectableTable initialSelected={new Set(['1', '3', '4'])} />,
|
|
154
149
|
}
|
|
155
150
|
|
|
156
151
|
export const Emphasized: Story = {
|
|
@@ -253,18 +248,14 @@ export const CustomLabel: Story = {
|
|
|
253
248
|
}
|
|
254
249
|
|
|
255
250
|
export const Hidden: Story = {
|
|
256
|
-
render: () => (
|
|
257
|
-
<SelectableTable initialSelected={new Set()} />
|
|
258
|
-
),
|
|
251
|
+
render: () => <SelectableTable initialSelected={new Set()} />,
|
|
259
252
|
}
|
|
260
253
|
|
|
261
254
|
export const AllVariants: Story = {
|
|
262
255
|
render: () => (
|
|
263
256
|
<html.div style={storyStyles.wrapper}>
|
|
264
257
|
<html.div>
|
|
265
|
-
<html.span style={storyStyles.label}>
|
|
266
|
-
Default — check boxes to see the ActionBar
|
|
267
|
-
</html.span>
|
|
258
|
+
<html.span style={storyStyles.label}>Default — check boxes to see the ActionBar</html.span>
|
|
268
259
|
<SelectableTable initialSelected={new Set(['1'])} />
|
|
269
260
|
</html.div>
|
|
270
261
|
</html.div>
|
|
@@ -29,9 +29,7 @@ function ActionBarInner({
|
|
|
29
29
|
if (selectedItemCount === 0) return null
|
|
30
30
|
|
|
31
31
|
const countStr = selectedItemCount === 'all' ? 'All' : `${selectedItemCount}`
|
|
32
|
-
const label = selectedLabel
|
|
33
|
-
? selectedLabel(countStr)
|
|
34
|
-
: `${countStr} selected`
|
|
32
|
+
const label = selectedLabel ? selectedLabel(countStr) : `${countStr} selected`
|
|
35
33
|
|
|
36
34
|
const bar = (
|
|
37
35
|
<html.div
|
|
@@ -39,32 +37,24 @@ function ActionBarInner({
|
|
|
39
37
|
aria-label={label}
|
|
40
38
|
style={[styles.overlay, isEmphasized && styles.overlayEmphasized]}
|
|
41
39
|
>
|
|
42
|
-
<html.span
|
|
43
|
-
style={[
|
|
44
|
-
styles.selectedCount,
|
|
45
|
-
isEmphasized && styles.selectedCountEmphasized,
|
|
46
|
-
]}
|
|
47
|
-
>
|
|
40
|
+
<html.span style={[styles.selectedCount, isEmphasized && styles.selectedCountEmphasized]}>
|
|
48
41
|
{label}
|
|
49
42
|
</html.span>
|
|
50
|
-
<html.div
|
|
51
|
-
style={[
|
|
52
|
-
styles.separator,
|
|
53
|
-
isEmphasized && styles.separatorEmphasized,
|
|
54
|
-
]}
|
|
55
|
-
/>
|
|
43
|
+
<html.div style={[styles.separator, isEmphasized && styles.separatorEmphasized]} />
|
|
56
44
|
<html.div style={styles.actions}>{children}</html.div>
|
|
57
45
|
<html.button
|
|
58
46
|
type="button"
|
|
59
47
|
aria-label="Clear selection"
|
|
60
48
|
onClick={onClearSelection}
|
|
61
|
-
style={[
|
|
62
|
-
styles.closeButton,
|
|
63
|
-
isEmphasized && styles.closeButtonEmphasized,
|
|
64
|
-
]}
|
|
49
|
+
style={[styles.closeButton, isEmphasized && styles.closeButtonEmphasized]}
|
|
65
50
|
>
|
|
66
51
|
<svg width={10} height={10} viewBox="0 0 10 10" fill="none" aria-hidden="true">
|
|
67
|
-
<path
|
|
52
|
+
<path
|
|
53
|
+
d="M1 1l8 8M9 1l-8 8"
|
|
54
|
+
stroke="currentColor"
|
|
55
|
+
strokeWidth={1.5}
|
|
56
|
+
strokeLinecap="round"
|
|
57
|
+
/>
|
|
68
58
|
</svg>
|
|
69
59
|
</html.button>
|
|
70
60
|
</html.div>
|
|
@@ -28,7 +28,13 @@ function Root({name, defaultValue, value, onValueChange, initialLabels, children
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// --- Trigger ---
|
|
31
|
-
function Trigger({
|
|
31
|
+
function Trigger({
|
|
32
|
+
children,
|
|
33
|
+
'aria-label': ariaLabel,
|
|
34
|
+
}: {
|
|
35
|
+
children: ReactNode
|
|
36
|
+
'aria-label'?: string
|
|
37
|
+
}) {
|
|
32
38
|
const {open, toggle, listboxId, highlightedId, triggerRef} = useSelect()
|
|
33
39
|
const localRef = useRef<HTMLButtonElement>(null)
|
|
34
40
|
|
|
@@ -125,7 +125,13 @@ const CellIndexContext = createContext<{index: number; total: number}>({
|
|
|
125
125
|
|
|
126
126
|
// --- HeaderCell ---
|
|
127
127
|
|
|
128
|
-
function HeaderCell({
|
|
128
|
+
function HeaderCell({
|
|
129
|
+
children,
|
|
130
|
+
'aria-label': ariaLabel,
|
|
131
|
+
}: {
|
|
132
|
+
children?: ReactNode
|
|
133
|
+
'aria-label'?: string
|
|
134
|
+
}) {
|
|
129
135
|
const {size, variant} = useTable()
|
|
130
136
|
const {index, total} = useContext(CellIndexContext)
|
|
131
137
|
const isLast = variant === 'bordered' && index === total - 1
|
package/src/index.ts
CHANGED
|
@@ -33,7 +33,11 @@ export {
|
|
|
33
33
|
export {Table, type TableVariant, type TableSize} from './components/Table/Table'
|
|
34
34
|
export {Tabs} from './components/Tabs/Tabs'
|
|
35
35
|
export {Textarea, type TextareaVariant} from './components/Textarea/Textarea'
|
|
36
|
-
export {
|
|
36
|
+
export {
|
|
37
|
+
ThemeProvider,
|
|
38
|
+
useOverlayContainer,
|
|
39
|
+
type ThemeName,
|
|
40
|
+
} from './components/ThemeProvider/ThemeProvider'
|
|
37
41
|
export {Text, type TextVariant, type TextColor} from './components/Text/Text'
|
|
38
42
|
export {Toggle, type ToggleSize} from './components/Toggle/Toggle'
|
|
39
43
|
export {ToggleGroup} from './components/ToggleGroup/ToggleGroup'
|