@shipfox/react-ui 0.25.0 → 0.26.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/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +3 -0
- package/dist/components/slider/slider.d.ts +10 -0
- package/dist/components/slider/slider.js +38 -0
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/dist/colors.stories.js +0 -61
- package/dist/components/alert/alert.stories.js +0 -227
- package/dist/components/avatar/avatar.stories.js +0 -267
- package/dist/components/badge/badge.stories.js +0 -802
- package/dist/components/button/button-link.stories.js +0 -127
- package/dist/components/button/button.stories.js +0 -187
- package/dist/components/button/icon-button.stories.js +0 -344
- package/dist/components/button-group/button-group.stories.js +0 -644
- package/dist/components/card/card.stories.js +0 -216
- package/dist/components/checkbox/checkbox.stories.js +0 -566
- package/dist/components/code-block/code-block.stories.js +0 -341
- package/dist/components/combobox/combobox.stories.js +0 -191
- package/dist/components/command/command.stories.js +0 -228
- package/dist/components/confetti/confetti.stories.js +0 -41
- package/dist/components/count-up/count-up.stories.js +0 -568
- package/dist/components/dashboard/components/charts/bar-chart.stories.js +0 -287
- package/dist/components/dashboard/components/charts/line-chart.stories.js +0 -257
- package/dist/components/dashboard/dashboard.stories.js +0 -23
- package/dist/components/date-picker/date-picker.stories.js +0 -349
- package/dist/components/dropdown-input/dropdown-input.stories.js +0 -240
- package/dist/components/dropdown-menu/dropdown-menu.stories.js +0 -462
- package/dist/components/dynamic-item/dynamic-item.stories.js +0 -385
- package/dist/components/empty-state/empty-state.stories.js +0 -74
- package/dist/components/form/form.stories.js +0 -587
- package/dist/components/icon/icon.stories.js +0 -38
- package/dist/components/inline-tips/inline-tips.stories.js +0 -219
- package/dist/components/input/input.stories.js +0 -265
- package/dist/components/interval-selector/interval-selector.stories.js +0 -232
- package/dist/components/item/item.stories.js +0 -239
- package/dist/components/kbd/kbd.stories.js +0 -119
- package/dist/components/label/label.stories.js +0 -105
- package/dist/components/modal/modal.stories.js +0 -566
- package/dist/components/search/search.stories.js +0 -630
- package/dist/components/select/select.stories.js +0 -393
- package/dist/components/sheet/sheet.stories.js +0 -368
- package/dist/components/skeleton/skeleton.stories.js +0 -345
- package/dist/components/table/table.stories.js +0 -302
- package/dist/components/tabs/tabs.stories.js +0 -179
- package/dist/components/textarea/textarea.stories.js +0 -339
- package/dist/components/toast/toast.stories.js +0 -326
- package/dist/components/tooltip/tooltip.stories.js +0 -560
- package/dist/components/typography/code.stories.js +0 -54
- package/dist/components/typography/header.stories.js +0 -34
- package/dist/components/typography/text.stories.js +0 -105
- package/dist/onboarding/sign-in.stories.js +0 -101
package/dist/components/index.js
CHANGED
|
@@ -36,6 +36,7 @@ export * from './select/index.js';
|
|
|
36
36
|
export * from './sheet/index.js';
|
|
37
37
|
export * from './shiny-text/index.js';
|
|
38
38
|
export * from './skeleton/index.js';
|
|
39
|
+
export * from './slider/index.js';
|
|
39
40
|
export * from './table/index.js';
|
|
40
41
|
export * from './tabs/index.js';
|
|
41
42
|
export * from './textarea/index.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export type SliderProps = ComponentProps<typeof SliderPrimitive.Root> & {
|
|
4
|
+
trackClassName?: string;
|
|
5
|
+
rangeClassName?: string;
|
|
6
|
+
thumbClassName?: string;
|
|
7
|
+
};
|
|
8
|
+
declare function Slider({ className, defaultValue, value, min, max, trackClassName, rangeClassName, thumbClassName, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Slider };
|
|
10
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
+
import { cn } from '../../utils/cn.js';
|
|
4
|
+
const trackDefaults = 'bg-background-switch-off relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-4';
|
|
5
|
+
const rangeDefaults = 'bg-foreground-highlight-interactive absolute select-none rounded-full data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full';
|
|
6
|
+
const thumbDefaults = "relative block size-6 min-w-6 min-h-6 shrink-0 select-none rounded-full border border-border-highlights-interactive bg-foreground-highlight-interactive drop-shadow transition-[color,box-shadow] outline-none after:absolute after:-inset-2 after:block after:content-[''] ring-2 ring-white ring-offset-2 data-disabled:pointer-events-none data-disabled:opacity-50";
|
|
7
|
+
function Slider({ className, defaultValue, value, min = 0, max = 100, trackClassName, rangeClassName, thumbClassName, ...props }) {
|
|
8
|
+
const values = Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [
|
|
9
|
+
min,
|
|
10
|
+
max
|
|
11
|
+
];
|
|
12
|
+
return /*#__PURE__*/ _jsxs(SliderPrimitive.Root, {
|
|
13
|
+
"data-slot": "slider",
|
|
14
|
+
defaultValue: defaultValue,
|
|
15
|
+
value: value,
|
|
16
|
+
min: min,
|
|
17
|
+
max: max,
|
|
18
|
+
className: cn('data-[orientation=vertical]:min-h-40 relative flex w-full touch-none select-none items-center data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col', className),
|
|
19
|
+
...props,
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx(SliderPrimitive.Track, {
|
|
22
|
+
"data-slot": "slider-track",
|
|
23
|
+
className: cn(trackDefaults, trackClassName),
|
|
24
|
+
children: /*#__PURE__*/ _jsx(SliderPrimitive.Range, {
|
|
25
|
+
"data-slot": "slider-range",
|
|
26
|
+
className: cn(rangeDefaults, rangeClassName)
|
|
27
|
+
})
|
|
28
|
+
}),
|
|
29
|
+
values.map((val)=>/*#__PURE__*/ _jsx(SliderPrimitive.Thumb, {
|
|
30
|
+
"data-slot": "slider-thumb",
|
|
31
|
+
className: cn(thumbDefaults, thumbClassName)
|
|
32
|
+
}, val))
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { Slider };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=slider.js.map
|