@central-ui/react 0.1.1 → 0.2.0
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/LICENSE +49 -0
- package/README.md +1 -1
- package/dist/components/accordion/index.d.ts +7 -6
- package/dist/components/accordion/index.js +13 -10
- package/dist/components/autocomplete/index.d.ts +22 -33
- package/dist/components/autocomplete/index.js +90 -73
- package/dist/components/avatar/index.d.ts +1 -2
- package/dist/components/avatar/index.js +6 -6
- package/dist/components/badge/index.d.ts +0 -1
- package/dist/components/badge/index.js +2 -2
- package/dist/components/banner/index.d.ts +1 -1
- package/dist/components/banner/index.js +24 -26
- package/dist/components/barchart/index.d.ts +106 -0
- package/dist/components/barchart/index.js +122 -0
- package/dist/components/breadcrumb/index.d.ts +0 -1
- package/dist/components/breadcrumb/index.js +6 -7
- package/dist/components/button/index.d.ts +3 -4
- package/dist/components/button/index.js +11 -12
- package/dist/components/card/index.d.ts +0 -1
- package/dist/components/card/index.js +0 -1
- package/dist/components/checkbox/index.d.ts +13 -11
- package/dist/components/checkbox/index.js +59 -39
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/index.js +2 -3
- package/dist/components/combobox/index.d.ts +32 -44
- package/dist/components/combobox/index.js +112 -88
- package/dist/components/datepicker/index.d.ts +54 -55
- package/dist/components/datepicker/index.js +105 -100
- package/dist/components/dialog/index.d.ts +17 -30
- package/dist/components/dialog/index.js +25 -26
- package/dist/components/divider/index.d.ts +0 -1
- package/dist/components/divider/index.js +0 -1
- package/dist/components/donutchart/index.d.ts +100 -0
- package/dist/components/donutchart/index.js +178 -0
- package/dist/components/drawer/index.d.ts +15 -24
- package/dist/components/drawer/index.js +45 -47
- package/dist/components/empty/index.d.ts +1 -2
- package/dist/components/empty/index.js +2 -4
- package/dist/components/fileupload/index.d.ts +4 -9
- package/dist/components/fileupload/index.js +27 -39
- package/dist/components/form/index.d.ts +0 -1
- package/dist/components/form/index.js +0 -1
- package/dist/components/horizontalbarchart/index.d.ts +120 -0
- package/dist/components/horizontalbarchart/index.js +193 -0
- package/dist/components/input/index.d.ts +23 -23
- package/dist/components/input/index.js +86 -115
- package/dist/components/linechart/index.d.ts +114 -0
- package/dist/components/linechart/index.js +139 -0
- package/dist/components/menu/index.d.ts +14 -16
- package/dist/components/menu/index.js +56 -53
- package/dist/components/metric/index.d.ts +0 -1
- package/dist/components/metric/index.js +0 -1
- package/dist/components/numberinput/index.d.ts +16 -23
- package/dist/components/numberinput/index.js +55 -68
- package/dist/components/otpinput/index.d.ts +14 -9
- package/dist/components/otpinput/index.js +32 -25
- package/dist/components/page/index.d.ts +0 -1
- package/dist/components/page/index.js +2 -4
- package/dist/components/passwordinput/index.d.ts +16 -13
- package/dist/components/passwordinput/index.js +47 -56
- package/dist/components/popover/index.d.ts +21 -19
- package/dist/components/popover/index.js +40 -21
- package/dist/components/radio/index.d.ts +13 -9
- package/dist/components/radio/index.js +80 -71
- package/dist/components/ratinginput/index.d.ts +15 -10
- package/dist/components/ratinginput/index.js +38 -18
- package/dist/components/select/index.d.ts +29 -32
- package/dist/components/select/index.js +79 -50
- package/dist/components/skeleton/index.d.ts +0 -1
- package/dist/components/skeleton/index.js +0 -1
- package/dist/components/slider/index.d.ts +14 -9
- package/dist/components/slider/index.js +75 -74
- package/dist/components/spinner/index.d.ts +2 -3
- package/dist/components/spinner/index.js +2 -3
- package/dist/components/splitter/index.d.ts +1 -2
- package/dist/components/splitter/index.js +6 -7
- package/dist/components/stepper/index.d.ts +8 -20
- package/dist/components/stepper/index.js +15 -16
- package/dist/components/switch/index.d.ts +12 -10
- package/dist/components/switch/index.js +52 -36
- package/dist/components/table/index.d.ts +3 -3
- package/dist/components/table/index.js +17 -16
- package/dist/components/tabs/index.d.ts +3 -4
- package/dist/components/tabs/index.js +6 -7
- package/dist/components/textarea/index.d.ts +16 -13
- package/dist/components/textarea/index.js +46 -55
- package/dist/components/textlink/index.d.ts +3 -1
- package/dist/components/textlink/index.js +4 -1
- package/dist/components/toast/index.d.ts +8 -14
- package/dist/components/toast/index.js +54 -54
- package/dist/components/toggle/index.d.ts +5 -6
- package/dist/components/toggle/index.js +19 -26
- package/dist/components/tooltip/index.d.ts +11 -13
- package/dist/components/tooltip/index.js +14 -11
- package/dist/components/tour/index.d.ts +154 -0
- package/dist/components/tour/index.js +280 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5 -1
- package/dist/types/Icon.d.ts +10 -0
- package/dist/types/Icon.js +1 -0
- package/dist/types/Style.d.ts +0 -1
- package/dist/types/Style.js +0 -1
- package/dist/types/Tone.d.ts +0 -1
- package/dist/types/Tone.js +0 -1
- package/dist/types/Validation.d.ts +12 -0
- package/dist/types/Validation.js +1 -0
- package/dist/utils/ArkStateToDataAttributes.d.ts +0 -1
- package/dist/utils/ArkStateToDataAttributes.js +3 -2
- package/dist/utils/Tone.d.ts +0 -1
- package/dist/utils/Tone.js +1 -2
- package/dist/utils/Validation.d.ts +14 -0
- package/dist/utils/Validation.js +23 -0
- package/dist/utils/asChild.d.ts +41 -0
- package/dist/utils/asChild.js +15 -0
- package/dist/utils/icons.d.ts +24 -0
- package/dist/utils/icons.js +160 -0
- package/dist/utils/useForwardClickToInput.d.ts +0 -1
- package/dist/utils/useForwardClickToInput.js +4 -3
- package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts +0 -1
- package/dist/utils/virtualization/useVirtualizedAutocomplete.js +0 -1
- package/dist/utils/virtualization/useVirtualizedCombobox.d.ts +0 -1
- package/dist/utils/virtualization/useVirtualizedCombobox.js +0 -1
- package/dist/utils/virtualization/useVirtualizedTable.d.ts +0 -1
- package/dist/utils/virtualization/useVirtualizedTable.js +0 -1
- package/package.json +12 -11
- package/src/presets/shopify-polaris/shopify-polaris-autocomplete.css +15 -6
- package/src/presets/shopify-polaris/shopify-polaris-badge.css +1 -1
- package/src/presets/shopify-polaris/shopify-polaris-barchart.css +64 -0
- package/src/presets/shopify-polaris/shopify-polaris-checkbox.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-chip.css +3 -3
- package/src/presets/shopify-polaris/shopify-polaris-combobox.css +19 -10
- package/src/presets/shopify-polaris/shopify-polaris-datepicker.css +20 -11
- package/src/presets/shopify-polaris/shopify-polaris-dialog.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-donutchart.css +172 -0
- package/src/presets/shopify-polaris/shopify-polaris-drawer.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-fileupload.css +1 -1
- package/src/presets/shopify-polaris/shopify-polaris-horizontalbarchart.css +60 -0
- package/src/presets/shopify-polaris/shopify-polaris-input.css +14 -5
- package/src/presets/shopify-polaris/shopify-polaris-linechart.css +68 -0
- package/src/presets/shopify-polaris/shopify-polaris-menu.css +47 -6
- package/src/presets/shopify-polaris/shopify-polaris-numberinput.css +16 -7
- package/src/presets/shopify-polaris/shopify-polaris-otpinput.css +3 -3
- package/src/presets/shopify-polaris/shopify-polaris-passwordinput.css +14 -5
- package/src/presets/shopify-polaris/shopify-polaris-popover.css +29 -0
- package/src/presets/shopify-polaris/shopify-polaris-radio.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-ratinginput.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-select.css +15 -6
- package/src/presets/shopify-polaris/shopify-polaris-slider.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-stepper.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris-switch.css +2 -2
- package/src/presets/shopify-polaris/shopify-polaris-textarea.css +13 -4
- package/src/presets/shopify-polaris/shopify-polaris-toast.css +43 -0
- package/src/presets/shopify-polaris/shopify-polaris-tooltip.css +16 -0
- package/src/presets/shopify-polaris/shopify-polaris.css +5 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-autocomplete.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-barchart.css +64 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-checkbox.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-combobox.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-datepicker.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-dialog.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-donutchart.css +172 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-drawer.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-fileupload.css +1 -1
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-horizontalbarchart.css +60 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-input.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-linechart.css +68 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-menu.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-numberinput.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-otpinput.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-passwordinput.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-popover.css +22 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-radio.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-ratinginput.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-slider.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-stepper.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-switch.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-textarea.css +2 -2
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy-tooltip.css +9 -0
- package/src/presets/shopify-polaris-legacy/shopify-polaris-legacy.css +4 -0
- package/dist/components/accordion/index.d.ts.map +0 -1
- package/dist/components/accordion/index.js.map +0 -1
- package/dist/components/autocomplete/index.d.ts.map +0 -1
- package/dist/components/autocomplete/index.js.map +0 -1
- package/dist/components/avatar/index.d.ts.map +0 -1
- package/dist/components/avatar/index.js.map +0 -1
- package/dist/components/badge/index.d.ts.map +0 -1
- package/dist/components/badge/index.js.map +0 -1
- package/dist/components/banner/index.d.ts.map +0 -1
- package/dist/components/banner/index.js.map +0 -1
- package/dist/components/breadcrumb/index.d.ts.map +0 -1
- package/dist/components/breadcrumb/index.js.map +0 -1
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/button/index.js.map +0 -1
- package/dist/components/card/index.d.ts.map +0 -1
- package/dist/components/card/index.js.map +0 -1
- package/dist/components/checkbox/index.d.ts.map +0 -1
- package/dist/components/checkbox/index.js.map +0 -1
- package/dist/components/chip/index.d.ts.map +0 -1
- package/dist/components/chip/index.js.map +0 -1
- package/dist/components/combobox/index.d.ts.map +0 -1
- package/dist/components/combobox/index.js.map +0 -1
- package/dist/components/datepicker/index.d.ts.map +0 -1
- package/dist/components/datepicker/index.js.map +0 -1
- package/dist/components/dialog/index.d.ts.map +0 -1
- package/dist/components/dialog/index.js.map +0 -1
- package/dist/components/divider/index.d.ts.map +0 -1
- package/dist/components/divider/index.js.map +0 -1
- package/dist/components/drawer/index.d.ts.map +0 -1
- package/dist/components/drawer/index.js.map +0 -1
- package/dist/components/empty/index.d.ts.map +0 -1
- package/dist/components/empty/index.js.map +0 -1
- package/dist/components/fileupload/index.d.ts.map +0 -1
- package/dist/components/fileupload/index.js.map +0 -1
- package/dist/components/form/index.d.ts.map +0 -1
- package/dist/components/form/index.js.map +0 -1
- package/dist/components/input/index.d.ts.map +0 -1
- package/dist/components/input/index.js.map +0 -1
- package/dist/components/menu/index.d.ts.map +0 -1
- package/dist/components/menu/index.js.map +0 -1
- package/dist/components/metric/index.d.ts.map +0 -1
- package/dist/components/metric/index.js.map +0 -1
- package/dist/components/numberinput/index.d.ts.map +0 -1
- package/dist/components/numberinput/index.js.map +0 -1
- package/dist/components/otpinput/index.d.ts.map +0 -1
- package/dist/components/otpinput/index.js.map +0 -1
- package/dist/components/page/index.d.ts.map +0 -1
- package/dist/components/page/index.js.map +0 -1
- package/dist/components/passwordinput/index.d.ts.map +0 -1
- package/dist/components/passwordinput/index.js.map +0 -1
- package/dist/components/popover/index.d.ts.map +0 -1
- package/dist/components/popover/index.js.map +0 -1
- package/dist/components/radio/index.d.ts.map +0 -1
- package/dist/components/radio/index.js.map +0 -1
- package/dist/components/ratinginput/index.d.ts.map +0 -1
- package/dist/components/ratinginput/index.js.map +0 -1
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/skeleton/index.d.ts.map +0 -1
- package/dist/components/skeleton/index.js.map +0 -1
- package/dist/components/slider/index.d.ts.map +0 -1
- package/dist/components/slider/index.js.map +0 -1
- package/dist/components/spinner/index.d.ts.map +0 -1
- package/dist/components/spinner/index.js.map +0 -1
- package/dist/components/splitter/index.d.ts.map +0 -1
- package/dist/components/splitter/index.js.map +0 -1
- package/dist/components/stepper/index.d.ts.map +0 -1
- package/dist/components/stepper/index.js.map +0 -1
- package/dist/components/switch/index.d.ts.map +0 -1
- package/dist/components/switch/index.js.map +0 -1
- package/dist/components/table/index.d.ts.map +0 -1
- package/dist/components/table/index.js.map +0 -1
- package/dist/components/tabs/index.d.ts.map +0 -1
- package/dist/components/tabs/index.js.map +0 -1
- package/dist/components/textarea/index.d.ts.map +0 -1
- package/dist/components/textarea/index.js.map +0 -1
- package/dist/components/textlink/index.d.ts.map +0 -1
- package/dist/components/textlink/index.js.map +0 -1
- package/dist/components/toast/index.d.ts.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/components/toggle/index.d.ts.map +0 -1
- package/dist/components/toggle/index.js.map +0 -1
- package/dist/components/tooltip/index.d.ts.map +0 -1
- package/dist/components/tooltip/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/Style.d.ts.map +0 -1
- package/dist/types/Style.js.map +0 -1
- package/dist/types/Tone.d.ts.map +0 -1
- package/dist/types/Tone.js.map +0 -1
- package/dist/utils/ArkStateToDataAttributes.d.ts.map +0 -1
- package/dist/utils/ArkStateToDataAttributes.js.map +0 -1
- package/dist/utils/Tone.d.ts.map +0 -1
- package/dist/utils/Tone.js.map +0 -1
- package/dist/utils/useForwardClickToInput.d.ts.map +0 -1
- package/dist/utils/useForwardClickToInput.js.map +0 -1
- package/dist/utils/virtualization/useVirtualizedAutocomplete.d.ts.map +0 -1
- package/dist/utils/virtualization/useVirtualizedAutocomplete.js.map +0 -1
- package/dist/utils/virtualization/useVirtualizedCombobox.d.ts.map +0 -1
- package/dist/utils/virtualization/useVirtualizedCombobox.js.map +0 -1
- package/dist/utils/virtualization/useVirtualizedTable.d.ts.map +0 -1
- package/dist/utils/virtualization/useVirtualizedTable.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export function arkStateToDataAttributes(state) {
|
|
2
2
|
return Object.fromEntries(Object.entries(state)
|
|
3
|
-
.filter(([, value]) => typeof value === 'boolean' ||
|
|
3
|
+
.filter(([, value]) => typeof value === 'boolean' ||
|
|
4
|
+
typeof value === 'string' ||
|
|
5
|
+
typeof value === 'number')
|
|
4
6
|
.map(([key, value]) => [
|
|
5
7
|
`data-${key.toLowerCase()}`,
|
|
6
8
|
typeof value === 'boolean' ? value || undefined : value,
|
|
7
9
|
]));
|
|
8
10
|
}
|
|
9
|
-
//# sourceMappingURL=ArkStateToDataAttributes.js.map
|
package/dist/utils/Tone.d.ts
CHANGED
package/dist/utils/Tone.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
|
-
const ToneContext = createContext('neutral');
|
|
2
|
+
const ToneContext = /* @__PURE__ */ createContext('neutral');
|
|
3
3
|
export const ToneProvider = ToneContext.Provider;
|
|
4
4
|
export function useToneContext() {
|
|
5
5
|
return useContext(ToneContext);
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=Tone.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Validation } from '../types/Validation.ts';
|
|
3
|
+
export declare function readValidation(validation?: Validation): {
|
|
4
|
+
state: "success" | "error" | undefined;
|
|
5
|
+
message: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare function validationAttributes(validation: ReturnType<typeof readValidation>): {
|
|
8
|
+
'data-validation': "success" | "error" | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Message children of Error and Success: omit them to show Root's validation message, pass a function to format that message, or pass content to replace it.
|
|
12
|
+
*/
|
|
13
|
+
export type ValidationMessageChildren = ReactNode | ((message: string) => ReactNode);
|
|
14
|
+
export declare function validationMessageContent(validation: ReturnType<typeof readValidation>, state: 'error' | 'success', children?: ValidationMessageChildren): ReactNode;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Choosing the state and message from the validation prop's two shapes, so parts read one normalized object
|
|
2
|
+
export function readValidation(validation) {
|
|
3
|
+
if (typeof validation === 'string')
|
|
4
|
+
return { state: validation, message: undefined };
|
|
5
|
+
return { state: validation?.[0], message: validation?.[1] };
|
|
6
|
+
}
|
|
7
|
+
// The state attribute carried by every part, so presets can style any part from Root's validation, like [data-validation='error']
|
|
8
|
+
export function validationAttributes(validation) {
|
|
9
|
+
return { 'data-validation': validation.state };
|
|
10
|
+
}
|
|
11
|
+
// Choosing what an Error or Success part shows, or undefined when it should stay hidden
|
|
12
|
+
export function validationMessageContent(validation, state, children) {
|
|
13
|
+
if (validation.state !== state)
|
|
14
|
+
return undefined;
|
|
15
|
+
// Static children show with the state alone, while the message and its formatting function need a message
|
|
16
|
+
if (children !== undefined && typeof children !== 'function')
|
|
17
|
+
return children;
|
|
18
|
+
if (!validation.message)
|
|
19
|
+
return undefined;
|
|
20
|
+
if (typeof children === 'function')
|
|
21
|
+
return children(validation.message);
|
|
22
|
+
return validation.message;
|
|
23
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
/** The asChild prop shared by the library's action parts. */
|
|
3
|
+
export type AsChildProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Gives this part's behavior to your own single child element, like your app's Button, instead of rendering its own button.
|
|
6
|
+
* The child keeps the state data attributes (like data-open or data-disabled) and accessibility props, but none of this part's styling.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** Decides the style attributes of an action part: none when asChild, since the consumer's child owns its appearance. */
|
|
12
|
+
export declare function asChildStyleAttributes(props: {
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
component: string;
|
|
15
|
+
disableStyle?: boolean;
|
|
16
|
+
}): {
|
|
17
|
+
'data-component'?: undefined;
|
|
18
|
+
'data-style-disabled'?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
'data-component': string;
|
|
21
|
+
'data-style-disabled': string | undefined;
|
|
22
|
+
};
|
|
23
|
+
/** Decides what a Base UI action part renders: the consumer's child as the element when asChild, otherwise the part's own styled element. */
|
|
24
|
+
export declare function asChildRendering(props: {
|
|
25
|
+
asChild?: boolean;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
component: string;
|
|
28
|
+
disableStyle?: boolean;
|
|
29
|
+
}): {
|
|
30
|
+
render: ReactElement;
|
|
31
|
+
} | {
|
|
32
|
+
'data-component'?: undefined;
|
|
33
|
+
'data-style-disabled'?: undefined;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
render?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
'data-component': string;
|
|
38
|
+
'data-style-disabled': string | undefined;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
render?: undefined;
|
|
41
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Decides the style attributes of an action part: none when asChild, since the consumer's child owns its appearance. */
|
|
2
|
+
export function asChildStyleAttributes(props) {
|
|
3
|
+
if (props.asChild)
|
|
4
|
+
return {};
|
|
5
|
+
return {
|
|
6
|
+
'data-component': props.component,
|
|
7
|
+
'data-style-disabled': props.disableStyle ? '' : undefined,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** Decides what a Base UI action part renders: the consumer's child as the element when asChild, otherwise the part's own styled element. */
|
|
11
|
+
export function asChildRendering(props) {
|
|
12
|
+
if (props.asChild)
|
|
13
|
+
return { render: props.children };
|
|
14
|
+
return { children: props.children, ...asChildStyleAttributes(props) };
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SVGIconProps } from '../types/Icon.ts';
|
|
2
|
+
export declare const ArrowLeft: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
3
|
+
export declare const CalendarDays: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
4
|
+
export declare const Check: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
5
|
+
export declare const ChevronDown: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
6
|
+
export declare const ChevronLeft: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
7
|
+
export declare const ChevronRight: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
8
|
+
export declare const ChevronUp: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
9
|
+
export declare const ChevronsUpDown: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
10
|
+
export declare const CircleAlert: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
11
|
+
export declare const CircleCheck: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
12
|
+
export declare const Eye: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
13
|
+
export declare const EyeOff: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
14
|
+
export declare const File: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
15
|
+
export declare const FolderOpen: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
16
|
+
export declare const GripVertical: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
17
|
+
export declare const Info: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
18
|
+
export declare const LoaderCircle: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
19
|
+
export declare const Minus: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
20
|
+
export declare const Star: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
21
|
+
export declare const Text: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
22
|
+
export declare const TriangleAlert: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
23
|
+
export declare const Upload: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
24
|
+
export declare const X: import("react").ForwardRefExoticComponent<Omit<SVGIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createElement, forwardRef } from 'react';
|
|
3
|
+
/** Builds a Lucide-compatible icon from its SVG elements, so the package ships only the icons it uses instead of the whole lucide-react catalog. Icon shapes are copied from lucide-react v1.57.0 (ISC license, https://lucide.dev). */
|
|
4
|
+
function createIcon(name, iconNode) {
|
|
5
|
+
const Icon = forwardRef(function Icon({ size = 24, width, height, color = 'currentColor', strokeWidth = 2, absoluteStrokeWidth, nonScalingStroke, className, children, ...props }, ref) {
|
|
6
|
+
// Keeping the stroke the same visual thickness at any size, when asked
|
|
7
|
+
const iconStrokeWidth = absoluteStrokeWidth
|
|
8
|
+
? (Number(strokeWidth) * 24) / Number(width ?? size)
|
|
9
|
+
: strokeWidth;
|
|
10
|
+
// Hiding the icon from screen readers unless it was given an accessible name
|
|
11
|
+
const hasAccessibleProp = Boolean(children) ||
|
|
12
|
+
Object.keys(props).some((prop) => prop.startsWith('aria-') || prop === 'role' || prop === 'title');
|
|
13
|
+
return (_jsxs("svg", { ref: ref, xmlns: "http://www.w3.org/2000/svg", width: width ?? size, height: height ?? size, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: iconStrokeWidth, strokeLinecap: "round", strokeLinejoin: "round", className: ['lucide', `lucide-${name}`, className]
|
|
14
|
+
.filter(Boolean)
|
|
15
|
+
.join(' '), "aria-hidden": hasAccessibleProp ? undefined : 'true', ...props, children: [iconNode.map(([tag, attributes], index) => createElement(tag, {
|
|
16
|
+
key: index,
|
|
17
|
+
vectorEffect: nonScalingStroke ? 'non-scaling-stroke' : undefined,
|
|
18
|
+
...attributes,
|
|
19
|
+
})), children] }));
|
|
20
|
+
});
|
|
21
|
+
Icon.displayName = name.replace(/(^|-)(\w)/g, (_match, _dash, letter) => letter.toUpperCase());
|
|
22
|
+
return Icon;
|
|
23
|
+
}
|
|
24
|
+
export const ArrowLeft = /* @__PURE__ */ createIcon('arrow-left', [
|
|
25
|
+
['path', { d: 'm12 19-7-7 7-7' }],
|
|
26
|
+
['path', { d: 'M19 12H5' }],
|
|
27
|
+
]);
|
|
28
|
+
export const CalendarDays = /* @__PURE__ */ createIcon('calendar-days', [
|
|
29
|
+
['path', { d: 'M8 2v3' }],
|
|
30
|
+
['path', { d: 'M16 2v3' }],
|
|
31
|
+
['rect', { x: '3', y: '3', width: '18', height: '18', rx: '2' }],
|
|
32
|
+
['path', { d: 'M3 9h18' }],
|
|
33
|
+
['path', { d: 'M8 13h.01' }],
|
|
34
|
+
['path', { d: 'M12 13h.01' }],
|
|
35
|
+
['path', { d: 'M16 13h.01' }],
|
|
36
|
+
['path', { d: 'M8 17h.01' }],
|
|
37
|
+
['path', { d: 'M12 17h.01' }],
|
|
38
|
+
['path', { d: 'M16 17h.01' }],
|
|
39
|
+
]);
|
|
40
|
+
export const Check = /* @__PURE__ */ createIcon('check', [
|
|
41
|
+
['path', { d: 'M20 6 9 17l-5-5' }],
|
|
42
|
+
]);
|
|
43
|
+
export const ChevronDown = /* @__PURE__ */ createIcon('chevron-down', [
|
|
44
|
+
['path', { d: 'm6 9 6 6 6-6' }],
|
|
45
|
+
]);
|
|
46
|
+
export const ChevronLeft = /* @__PURE__ */ createIcon('chevron-left', [
|
|
47
|
+
['path', { d: 'm15 18-6-6 6-6' }],
|
|
48
|
+
]);
|
|
49
|
+
export const ChevronRight = /* @__PURE__ */ createIcon('chevron-right', [
|
|
50
|
+
['path', { d: 'm9 18 6-6-6-6' }],
|
|
51
|
+
]);
|
|
52
|
+
export const ChevronUp = /* @__PURE__ */ createIcon('chevron-up', [
|
|
53
|
+
['path', { d: 'm18 15-6-6-6 6' }],
|
|
54
|
+
]);
|
|
55
|
+
export const ChevronsUpDown = /* @__PURE__ */ createIcon('chevrons-up-down', [
|
|
56
|
+
['path', { d: 'm7 15 5 5 5-5' }],
|
|
57
|
+
['path', { d: 'm7 9 5-5 5 5' }],
|
|
58
|
+
]);
|
|
59
|
+
export const CircleAlert = /* @__PURE__ */ createIcon('circle-alert', [
|
|
60
|
+
['circle', { cx: '12', cy: '12', r: '10' }],
|
|
61
|
+
['line', { x1: '12', x2: '12', y1: '8', y2: '12' }],
|
|
62
|
+
['line', { x1: '12', x2: '12.01', y1: '16', y2: '16' }],
|
|
63
|
+
]);
|
|
64
|
+
export const CircleCheck = /* @__PURE__ */ createIcon('circle-check', [
|
|
65
|
+
['circle', { cx: '12', cy: '12', r: '10' }],
|
|
66
|
+
['path', { d: 'm16 9-5.5 5.5L8 12' }],
|
|
67
|
+
]);
|
|
68
|
+
export const Eye = /* @__PURE__ */ createIcon('eye', [
|
|
69
|
+
[
|
|
70
|
+
'path',
|
|
71
|
+
{
|
|
72
|
+
d: 'M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
['circle', { cx: '12', cy: '12', r: '3' }],
|
|
76
|
+
]);
|
|
77
|
+
export const EyeOff = /* @__PURE__ */ createIcon('eye-off', [
|
|
78
|
+
[
|
|
79
|
+
'path',
|
|
80
|
+
{
|
|
81
|
+
d: 'M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
['path', { d: 'M14.084 14.158a3 3 0 0 1-4.242-4.242' }],
|
|
85
|
+
[
|
|
86
|
+
'path',
|
|
87
|
+
{
|
|
88
|
+
d: 'M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
['path', { d: 'm2 2 20 20' }],
|
|
92
|
+
]);
|
|
93
|
+
export const File = /* @__PURE__ */ createIcon('file', [
|
|
94
|
+
[
|
|
95
|
+
'path',
|
|
96
|
+
{
|
|
97
|
+
d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5' }],
|
|
101
|
+
]);
|
|
102
|
+
export const FolderOpen = /* @__PURE__ */ createIcon('folder-open', [
|
|
103
|
+
[
|
|
104
|
+
'path',
|
|
105
|
+
{
|
|
106
|
+
d: 'm6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
]);
|
|
110
|
+
export const GripVertical = /* @__PURE__ */ createIcon('grip-vertical', [
|
|
111
|
+
['circle', { cx: '9', cy: '12', r: '1' }],
|
|
112
|
+
['circle', { cx: '9', cy: '5', r: '1' }],
|
|
113
|
+
['circle', { cx: '9', cy: '19', r: '1' }],
|
|
114
|
+
['circle', { cx: '15', cy: '12', r: '1' }],
|
|
115
|
+
['circle', { cx: '15', cy: '5', r: '1' }],
|
|
116
|
+
['circle', { cx: '15', cy: '19', r: '1' }],
|
|
117
|
+
]);
|
|
118
|
+
export const Info = /* @__PURE__ */ createIcon('info', [
|
|
119
|
+
['circle', { cx: '12', cy: '12', r: '10' }],
|
|
120
|
+
['path', { d: 'M12 16v-4' }],
|
|
121
|
+
['path', { d: 'M12 8h.01' }],
|
|
122
|
+
]);
|
|
123
|
+
export const LoaderCircle = /* @__PURE__ */ createIcon('loader-circle', [
|
|
124
|
+
['path', { d: 'M21 12a9 9 0 1 1-6.219-8.56' }],
|
|
125
|
+
]);
|
|
126
|
+
export const Minus = /* @__PURE__ */ createIcon('minus', [
|
|
127
|
+
['path', { d: 'M5 12h14' }],
|
|
128
|
+
]);
|
|
129
|
+
export const Star = /* @__PURE__ */ createIcon('star', [
|
|
130
|
+
[
|
|
131
|
+
'path',
|
|
132
|
+
{
|
|
133
|
+
d: 'M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
]);
|
|
137
|
+
export const Text = /* @__PURE__ */ createIcon('text-align-start', [
|
|
138
|
+
['path', { d: 'M21 5H3' }],
|
|
139
|
+
['path', { d: 'M15 12H3' }],
|
|
140
|
+
['path', { d: 'M17 19H3' }],
|
|
141
|
+
]);
|
|
142
|
+
export const TriangleAlert = /* @__PURE__ */ createIcon('triangle-alert', [
|
|
143
|
+
[
|
|
144
|
+
'path',
|
|
145
|
+
{
|
|
146
|
+
d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3',
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
['path', { d: 'M12 9v4' }],
|
|
150
|
+
['path', { d: 'M12 17h.01' }],
|
|
151
|
+
]);
|
|
152
|
+
export const Upload = /* @__PURE__ */ createIcon('upload', [
|
|
153
|
+
['path', { d: 'M12 3v12' }],
|
|
154
|
+
['path', { d: 'm17 8-5-5-5 5' }],
|
|
155
|
+
['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }],
|
|
156
|
+
]);
|
|
157
|
+
export const X = /* @__PURE__ */ createIcon('x', [
|
|
158
|
+
['path', { d: 'M18 6 6 18' }],
|
|
159
|
+
['path', { d: 'm6 6 12 12' }],
|
|
160
|
+
]);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { MouseEventHandler } from 'react';
|
|
2
2
|
/** Forward clicks on an input group to its input without calling the group's handler twice. */
|
|
3
3
|
export declare function useForwardClickToInput<T extends HTMLElement>(selector: string, onClick?: MouseEventHandler<T>): MouseEventHandler<T>;
|
|
4
|
-
//# sourceMappingURL=useForwardClickToInput.d.ts.map
|
|
@@ -8,10 +8,12 @@ export function useForwardClickToInput(selector, onClick) {
|
|
|
8
8
|
onClick?.(event);
|
|
9
9
|
if (event.defaultPrevented)
|
|
10
10
|
return;
|
|
11
|
-
if (event.target instanceof Element &&
|
|
11
|
+
if (event.target instanceof Element &&
|
|
12
|
+
event.target.closest('button, [data-part="item"]'))
|
|
12
13
|
return;
|
|
13
14
|
const input = event.currentTarget.querySelector(selector);
|
|
14
|
-
if (!input ||
|
|
15
|
+
if (!input ||
|
|
16
|
+
(event.target instanceof Element && event.target.matches(selector)))
|
|
15
17
|
return;
|
|
16
18
|
forwardingClick.current = true;
|
|
17
19
|
try {
|
|
@@ -24,4 +26,3 @@ export function useForwardClickToInput(selector, onClick) {
|
|
|
24
26
|
input.focus();
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
|
-
//# sourceMappingURL=useForwardClickToInput.js.map
|
|
@@ -195,4 +195,3 @@ export declare function FilteredItemsSync<Item extends ItemShape>({ onChange, }:
|
|
|
195
195
|
/** Spread the hook's filteredItemsSyncProps here to sync all native search results, not just mounted rows. */
|
|
196
196
|
onChange: (items: Item[]) => void;
|
|
197
197
|
}): null;
|
|
198
|
-
//# sourceMappingURL=useVirtualizedAutocomplete.d.ts.map
|
|
@@ -197,4 +197,3 @@ export declare function FilteredItemsSync<Item extends ItemShape>({ onChange, }:
|
|
|
197
197
|
/** Spread the hook's filteredItemsSyncProps here to sync all native search results, not just mounted rows. */
|
|
198
198
|
onChange: (items: Item[]) => void;
|
|
199
199
|
}): null;
|
|
200
|
-
//# sourceMappingURL=useVirtualizedCombobox.d.ts.map
|
|
@@ -166,4 +166,3 @@ export declare function useVirtualizedTable<TItem>({ items, getItemKey, estimate
|
|
|
166
166
|
scrollToIndex: (index: number, options?: Parameters<(index: number, { align: initialAlign, behavior, }?: import("@tanstack/virtual-core").ScrollToOptions) => void>[1]) => void;
|
|
167
167
|
virtualizer: import("@tanstack/react-virtual").ReactVirtualizer<HTMLTableSectionElement, HTMLTableRowElement>;
|
|
168
168
|
};
|
|
169
|
-
//# sourceMappingURL=useVirtualizedTable.d.ts.map
|
|
@@ -124,4 +124,3 @@ export function useVirtualizedTable({ items, getItemKey, estimateSize = 34, over
|
|
|
124
124
|
const scrollToIndex = useCallback((index, options) => virtualizer.scrollToIndex(index, { align: 'auto', ...options }), [virtualizer]);
|
|
125
125
|
return { bodyProps, rows, spacers, scrollToIndex, virtualizer };
|
|
126
126
|
}
|
|
127
|
-
//# sourceMappingURL=useVirtualizedTable.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@central-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Accessible React components with optional Tailwind CSS style presets",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -52,15 +52,16 @@
|
|
|
52
52
|
"typescript": "6.0.3"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@ark-ui/react": "5.39.3",
|
|
56
|
-
"@base-ui/react": "1.9.0",
|
|
57
|
-
"@internationalized/date": "3.12.4",
|
|
58
|
-
"@radix-ui/react-password-toggle-field": "0.2.1",
|
|
59
|
-
"@tanstack/react-virtual": "3.14.20",
|
|
60
|
-
"
|
|
61
|
-
"react-aria": "
|
|
62
|
-
"react-
|
|
63
|
-
"react-resizable-panels": "4.14.5",
|
|
64
|
-
"
|
|
55
|
+
"@ark-ui/react": "^5.39.3",
|
|
56
|
+
"@base-ui/react": "^1.9.0",
|
|
57
|
+
"@internationalized/date": "^3.12.4",
|
|
58
|
+
"@radix-ui/react-password-toggle-field": "^0.2.1",
|
|
59
|
+
"@tanstack/react-virtual": "^3.14.20",
|
|
60
|
+
"react-aria": "^3.53.1",
|
|
61
|
+
"react-aria-components": "^1.22.1",
|
|
62
|
+
"react-joyride": "^3.2.0",
|
|
63
|
+
"react-resizable-panels": "^4.14.5",
|
|
64
|
+
"recharts": "^3.10.1",
|
|
65
|
+
"tailwind-merge": "^3.7.0"
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
&:where([data-component='autocomplete-input']) {
|
|
13
|
-
@apply min-w-12 flex-1 h-
|
|
13
|
+
@apply min-w-12 flex-1 h-8 rounded-none border-0 bg-transparent px-2.5 py-0 text-sm text-neutral-950 shadow-none outline-none placeholder:text-sm placeholder:text-neutral-600 hover:bg-transparent focus:outline-none disabled:cursor-not-allowed disabled:text-neutral-400;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
&:where([data-component='autocomplete-scrollarea']) {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&:where([data-component='autocomplete-item']) {
|
|
33
|
-
@apply flex h-
|
|
33
|
+
@apply flex h-7 w-full shrink-0 cursor-pointer items-center justify-between gap-2 rounded-xl px-2 text-sm font-normal text-nowrap text-neutral-950 outline-none data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-30 data-highlighted:bg-neutral-100 active:bg-neutral-200;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&:where([data-component='autocomplete-popup']) {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
&:where([data-component='autocomplete-addon']) {
|
|
60
|
-
@apply inline-flex h-
|
|
60
|
+
@apply inline-flex h-8 shrink-0 items-center gap-2 empty:hidden px-2 py-1;
|
|
61
61
|
&[data-variant='emphasized'] {
|
|
62
62
|
@apply bg-neutral-200/60;
|
|
63
63
|
}
|
|
@@ -75,15 +75,24 @@
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
&:where([data-component='autocomplete-inputgroup']) {
|
|
78
|
-
@apply p-0 flex w-full min-w-0 items-center overflow-hidden rounded-xl border border-neutral-
|
|
79
|
-
&[data-
|
|
78
|
+
@apply p-0 flex w-full min-w-0 items-center overflow-hidden rounded-xl border border-neutral-300 bg-white text-[0.8rem] text-neutral-950 shadow-xs outline-none hover:bg-neutral-50 focus-within:border-blue-500 focus-within:ring-2 focus-within:ring-blue-500/10 focus-within:shadow-sm data-disabled:cursor-not-allowed data-disabled:border-neutral-200 data-disabled:bg-white data-disabled:text-neutral-400 data-disabled:shadow-none data-disabled:hover:bg-white data-readonly:cursor-not-allowed data-readonly:border-neutral-200 data-readonly:bg-neutral-50 data-readonly:hover:bg-neutral-50 data-readonly:shadow-none;
|
|
79
|
+
&[data-validation='error'] {
|
|
80
80
|
@apply border-red-500 focus-within:border-red-500 focus-within:ring-red-500/10;
|
|
81
81
|
}
|
|
82
|
-
&[data-
|
|
82
|
+
&[data-validation='success'] {
|
|
83
83
|
@apply border-green-600 focus-within:border-green-600 focus-within:ring-green-600/10;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
&:where([data-component='autocomplete-inputgroup'])
|
|
88
|
+
:where(
|
|
89
|
+
svg:not([data-style-disabled]):not(
|
|
90
|
+
[data-component='combobox-chipremovebuttonicon']
|
|
91
|
+
):not([data-component='chip-closebuttonicon'])
|
|
92
|
+
) {
|
|
93
|
+
@apply text-neutral-600;
|
|
94
|
+
}
|
|
95
|
+
|
|
87
96
|
&:where([data-component='autocomplete-addonopenbutton']) {
|
|
88
97
|
@apply flex h-4 w-auto shrink-0 cursor-pointer items-center justify-center rounded-full p-0 text-neutral-600 hover:text-neutral-700 active:text-neutral-800 focus-visible:outline-2 focus-visible:outline-blue-500 disabled:pointer-events-none disabled:opacity-50;
|
|
89
98
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@layer components {
|
|
3
3
|
:where(:not([data-style-disabled])) {
|
|
4
4
|
&:where([data-component='badge-badge']) {
|
|
5
|
-
@apply flex h-[1.28rem] min-w-[1.425rem] w-fit shrink-0 items-center justify-center gap-1 truncate rounded-
|
|
5
|
+
@apply flex h-[1.28rem] min-w-[1.425rem] w-fit shrink-0 items-center justify-center gap-1 truncate rounded-md px-2 text-nowrap text-[0.8rem] font-semibold leading-none [&>svg]:h-3.5 [&>svg]:w-fit;
|
|
6
6
|
&[data-tone='neutral'] {
|
|
7
7
|
@apply bg-[#0000000d] text-[#4a4a4a];
|
|
8
8
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* barchart */
|
|
2
|
+
@layer components {
|
|
3
|
+
:where(:not([data-style-disabled])) {
|
|
4
|
+
&:where([data-component='barchart-gridline']) {
|
|
5
|
+
@apply stroke-neutral-200;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&:where([data-component='barchart-xaxis-ticklabel']) {
|
|
9
|
+
@apply fill-neutral-500;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&:where([data-component='barchart-yaxis-ticklabel']) {
|
|
13
|
+
@apply fill-neutral-500;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:where([data-component='barchart-xaxis-line']) {
|
|
17
|
+
@apply stroke-neutral-300;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:where([data-component='barchart-yaxis-line']) {
|
|
21
|
+
@apply stroke-neutral-300;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:where([data-component='barchart-xaxis-tickline']) {
|
|
25
|
+
@apply stroke-neutral-300;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:where([data-component='barchart-yaxis-tickline']) {
|
|
29
|
+
@apply stroke-neutral-300;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:where([data-component='barchart-hoverguide']) {
|
|
33
|
+
@apply stroke-neutral-400/50;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:where([data-component='barchart-bar']) {
|
|
37
|
+
@apply fill-[#13ACF0];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:where([data-component='barchart-bar'])[data-active] {
|
|
41
|
+
@apply opacity-80;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:where([data-component='barchart-tooltip']) {
|
|
45
|
+
@apply grid min-w-56 grid-cols-[auto_1fr] items-center gap-x-1 gap-y-2 rounded-md border border-neutral-700 bg-neutral-900 p-2.5 shadow-md;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:where([data-component='barchart-tooltiptitle']) {
|
|
49
|
+
@apply col-span-full row-start-1 text-xs font-semibold leading-4 text-neutral-200;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:where([data-component='barchart-tooltiplabel']) {
|
|
53
|
+
@apply col-start-2 row-start-2 text-xs font-medium leading-4 text-neutral-400;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:where([data-component='barchart-tooltipvalue']) {
|
|
57
|
+
@apply col-span-full row-start-3 justify-self-start rounded-md bg-neutral-600 px-1.25 py-0.5 font-mono text-sm font-medium leading-5 text-neutral-200 tabular-nums;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:where([data-component='barchart-tooltipcolorindicator']) {
|
|
61
|
+
@apply col-start-1 row-start-2 h-2.5 w-2.5 rounded-sm bg-[#13ACF0];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
&:where([data-component='checkbox-button']) {
|
|
13
13
|
@apply mt-0.5 row-start-1 flex size-4.25 shrink-0 cursor-pointer items-center justify-center rounded-sm border border-neutral-300 bg-white text-white shadow-xs transition-all duration-150 data-checked:border-neutral-950 data-checked:bg-neutral-950 data-indeterminate:border-neutral-950 data-indeterminate:bg-neutral-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 data-disabled:cursor-not-allowed data-disabled:opacity-50;
|
|
14
|
-
&[data-
|
|
14
|
+
&[data-validation='error'] {
|
|
15
15
|
@apply border-red-600 bg-red-50 data-checked:border-red-600 data-checked:bg-red-600 data-indeterminate:border-red-600 data-indeterminate:bg-red-600;
|
|
16
16
|
}
|
|
17
|
-
&[data-
|
|
17
|
+
&[data-validation='success'] {
|
|
18
18
|
@apply border-green-700 bg-green-50 data-checked:border-green-700 data-checked:bg-green-700 data-indeterminate:border-green-700 data-indeterminate:bg-green-700;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
@layer components {
|
|
3
3
|
:where(:not([data-style-disabled])) {
|
|
4
4
|
&:where([data-component='chip-chip']) {
|
|
5
|
-
@apply flex h-
|
|
5
|
+
@apply flex h-5 min-w-6 w-fit shrink-0 items-center justify-between gap-1 rounded-md bg-neutral-100 px-2 text-[0.8rem] leading-none font-medium text-nowrap text-neutral-700 data-disabled:opacity-50;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
&:where([data-component='chip-closebutton']) {
|
|
9
|
-
@apply -mr-1.75 flex h-4.25 aspect-square w-auto cursor-pointer items-center justify-center rounded-
|
|
9
|
+
@apply -mr-1.75 flex h-4.25 aspect-square w-auto shrink-0 cursor-pointer items-center justify-center rounded-md p-0 hover:bg-neutral-200 active:bg-neutral-200 focus-visible:outline-2 focus-visible:outline-blue-500 disabled:pointer-events-none disabled:opacity-50;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
&:where([data-component='chip-closebuttonicon']) {
|
|
13
|
-
@apply h-3.25 w-fit text-
|
|
13
|
+
@apply h-3.25 w-fit shrink-0 text-neutral-700;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|