@profiq/ui 0.1.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/README.md +36 -0
- package/dist/components/custom/basic/accordion.d.ts +31 -0
- package/dist/components/custom/basic/accordion.d.ts.map +1 -0
- package/dist/components/custom/basic/accordion.js +68 -0
- package/dist/components/custom/basic/button.d.ts +16 -0
- package/dist/components/custom/basic/button.d.ts.map +1 -0
- package/dist/components/custom/basic/button.js +46 -0
- package/dist/components/custom/basic/input.d.ts +22 -0
- package/dist/components/custom/basic/input.d.ts.map +1 -0
- package/dist/components/custom/basic/input.js +106 -0
- package/dist/components/custom/basic/select.d.ts +18 -0
- package/dist/components/custom/basic/select.d.ts.map +1 -0
- package/dist/components/custom/basic/select.js +67 -0
- package/dist/components/custom/basic/slider.d.ts +24 -0
- package/dist/components/custom/basic/slider.d.ts.map +1 -0
- package/dist/components/custom/basic/slider.js +54 -0
- package/dist/components/custom/basic/switch.d.ts +17 -0
- package/dist/components/custom/basic/switch.d.ts.map +1 -0
- package/dist/components/custom/basic/switch.js +105 -0
- package/dist/components/custom/basic/table.d.ts +9 -0
- package/dist/components/custom/basic/table.d.ts.map +1 -0
- package/dist/components/custom/basic/table.js +74 -0
- package/dist/components/custom/basic/text.d.ts +10 -0
- package/dist/components/custom/basic/text.d.ts.map +1 -0
- package/dist/components/custom/basic/text.js +26 -0
- package/dist/components/custom/basic/textarea.d.ts +7 -0
- package/dist/components/custom/basic/textarea.d.ts.map +1 -0
- package/dist/components/custom/basic/textarea.js +24 -0
- package/dist/components/custom/icons/Backpack.d.ts +3 -0
- package/dist/components/custom/icons/Backpack.d.ts.map +1 -0
- package/dist/components/custom/icons/Backpack.js +28 -0
- package/dist/components/custom/icons/CaretDown.d.ts +3 -0
- package/dist/components/custom/icons/CaretDown.d.ts.map +1 -0
- package/dist/components/custom/icons/CaretDown.js +20 -0
- package/dist/components/custom/icons/CaretUp.d.ts +3 -0
- package/dist/components/custom/icons/CaretUp.d.ts.map +1 -0
- package/dist/components/custom/icons/CaretUp.js +20 -0
- package/dist/components/custom/icons/DotsVertical.d.ts +3 -0
- package/dist/components/custom/icons/DotsVertical.d.ts.map +1 -0
- package/dist/components/custom/icons/DotsVertical.js +28 -0
- package/dist/components/custom/icons/HamburgerMenu.d.ts +3 -0
- package/dist/components/custom/icons/HamburgerMenu.d.ts.map +1 -0
- package/dist/components/custom/icons/HamburgerMenu.js +28 -0
- package/dist/components/custom/icons/Home.d.ts +3 -0
- package/dist/components/custom/icons/Home.d.ts.map +1 -0
- package/dist/components/custom/icons/Home.js +28 -0
- package/dist/components/custom/icons/Icons.d.ts +27 -0
- package/dist/components/custom/icons/Icons.d.ts.map +1 -0
- package/dist/components/custom/icons/Icons.js +23 -0
- package/dist/components/custom/icons/MagnifyingGlass.d.ts +3 -0
- package/dist/components/custom/icons/MagnifyingGlass.d.ts.map +1 -0
- package/dist/components/custom/icons/MagnifyingGlass.js +24 -0
- package/dist/components/custom/icons/Moon.d.ts +3 -0
- package/dist/components/custom/icons/Moon.d.ts.map +1 -0
- package/dist/components/custom/icons/Moon.js +28 -0
- package/dist/components/custom/icons/Sun.d.ts +3 -0
- package/dist/components/custom/icons/Sun.d.ts.map +1 -0
- package/dist/components/custom/icons/Sun.js +28 -0
- package/dist/components/custom/icons/logo/Profiq.d.ts +6 -0
- package/dist/components/custom/icons/logo/Profiq.d.ts.map +1 -0
- package/dist/components/custom/icons/logo/Profiq.js +92 -0
- package/dist/components/custom/icons/logo/logoVariations.d.ts +10 -0
- package/dist/components/custom/icons/logo/logoVariations.d.ts.map +1 -0
- package/dist/components/custom/icons/logo/logoVariations.js +65 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +65 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +29 -0
- package/dist/components/ui/buttonVariants.d.ts +5 -0
- package/dist/components/ui/buttonVariants.d.ts.map +1 -0
- package/dist/components/ui/buttonVariants.js +33 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +221 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +22 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +23 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +181 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +27 -0
- package/dist/components/ui/slider.d.ts +13 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +101 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +36 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +115 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +19 -0
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +66 -0
- package/dist/fonts/Franklin_Gothic/FRANKGO.ttf +0 -0
- package/dist/fonts/Franklin_Gothic/Franklin Gothic Condensed.ttf +0 -0
- package/dist/fonts/Franklin_Gothic/FranklinGothic.ttf +0 -0
- package/dist/fonts/Franklin_Gothic/FranklinGothicITALIC.ttf +0 -0
- package/dist/fonts/Franklin_Gothic/fgwo____.ttf +0 -0
- package/dist/fonts/Roboto_Slab/LICENSE.txt +202 -0
- package/dist/fonts/Roboto_Slab/README.txt +71 -0
- package/dist/fonts/Roboto_Slab/RobotoSlab-VariableFont_wght.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-Black.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-Bold.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-ExtraBold.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-ExtraLight.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-Light.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-Medium.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-Regular.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-SemiBold.ttf +0 -0
- package/dist/fonts/Roboto_Slab/static/RobotoSlab-Thin.ttf +0 -0
- package/dist/index.css +571 -0
- package/dist/index.js +11 -0
- package/dist/lib/baseProps.d.ts +9 -0
- package/dist/lib/baseProps.d.ts.map +1 -0
- package/dist/lib/baseProps.js +13 -0
- package/dist/lib/buttonVariants.d.ts +3 -0
- package/dist/lib/buttonVariants.d.ts.map +1 -0
- package/dist/lib/hooks/useMakeTestId.d.ts +34 -0
- package/dist/lib/hooks/useMakeTestId.d.ts.map +1 -0
- package/dist/lib/hooks/useMakeTestId.js +26 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/text.types.d.ts +6 -0
- package/dist/lib/text.types.d.ts.map +1 -0
- package/dist/lib/text.types.js +17 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +532 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +402 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +208 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
- package/dist/node_modules/@radix-ui/number/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +9 -0
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +235 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +120 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +53 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +13 -0
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +19 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +219 -0
- package/dist/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +848 -0
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +436 -0
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +61 -0
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +132 -0
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +338 -0
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +55 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +88 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1667 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
- package/dist/node_modules/class-variance-authority/dist/index.js +35 -0
- package/dist/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +36 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +6 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +6 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +6 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js +4 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js +4 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js +8 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +115 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +68 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2924 -0
- package/dist/node_modules/tslib/tslib.es6.js +27 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
- package/package.json +124 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# profiq-ui
|
|
2
|
+
|
|
3
|
+
Hosted on [pq-profiq-ui](https://ui-react.profiq.com)
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
Create a React component library which will be re-used by profiq internal applications.
|
|
8
|
+
|
|
9
|
+
## How
|
|
10
|
+
|
|
11
|
+
- The main part of this project will be Storybook https://storybook.js.org/ for creating the library.
|
|
12
|
+
- Take a look at Storybook showcase how projects like this are run
|
|
13
|
+
- For creating the components we will used ShadCN (https://ui.shadcn.com/) with Tailwind.
|
|
14
|
+
- All the components should have tests and examples in the storybook
|
|
15
|
+
- Which components to implement? Take a look at this app https://gitlab.com/profiq/all/infra/equipment-budgets ideally later on we would be able to replace components with our
|
|
16
|
+
- Ideally we will have all the components which ShadCN offers by default - but probably start with the ones you would use in form & move to the one used in the app
|
|
17
|
+
- Theme
|
|
18
|
+
- Light / Dark theme -- focus on light theme as default
|
|
19
|
+
- Design manual https://drive.google.com/file/d/1vc9bbzwF3E9hjGXcHxEDQZGeakknA6rF/view?usp=sharing
|
|
20
|
+
- Please try to build some nice theme - try not to change things that much (don't look at our other internal apps), you can take inspiration at https://www.profiq.com/ and maybe try to do less changes from default then more
|
|
21
|
+
- Build CI/CD pipeline
|
|
22
|
+
- Add tests / prettier / and other checks
|
|
23
|
+
- Automate deplyoments (on GIT tags / should be in sync with package.json version)
|
|
24
|
+
|
|
25
|
+
### Technology stack
|
|
26
|
+
|
|
27
|
+
- Typescript
|
|
28
|
+
- Storybook
|
|
29
|
+
- ShadCN & Tailwind
|
|
30
|
+
|
|
31
|
+
### Released
|
|
32
|
+
|
|
33
|
+
- We will be releasing on NPM under this account https://www.npmjs.com/~profiq-npm
|
|
34
|
+
- Name of the package probably @profiq/ui
|
|
35
|
+
|
|
36
|
+
- We will also host the sotrybook interface online https://ui-react.profiq.com (probably on Firebase) - TBD figure out how to do it
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseProps } from '../../lib/baseProps';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type Item = {
|
|
4
|
+
value: string;
|
|
5
|
+
trigger: React.ReactNode;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type CommonAccordionProps = BaseProps & {
|
|
10
|
+
items: Item[];
|
|
11
|
+
className?: string;
|
|
12
|
+
collapsible?: boolean;
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
border?: boolean;
|
|
15
|
+
};
|
|
16
|
+
type SingleAccordionProps = CommonAccordionProps & {
|
|
17
|
+
type: "single";
|
|
18
|
+
value?: string;
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
onValueChange?(value: string): void;
|
|
21
|
+
};
|
|
22
|
+
type MultipleAccordionProps = CommonAccordionProps & {
|
|
23
|
+
type: "multiple";
|
|
24
|
+
value?: string[];
|
|
25
|
+
defaultValue?: string[];
|
|
26
|
+
onValueChange?(value: string[]): void;
|
|
27
|
+
};
|
|
28
|
+
export type AccordionProps = SingleAccordionProps | MultipleAccordionProps;
|
|
29
|
+
export declare function Accordion({ dataTestId, theme, ariaLabel, className, items, collapsible, type, defaultValue, border, }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/stories/basic/accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,oBAAoB,GAAG,SAAS,GAAG;IACtC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG,oBAAoB,GAAG;IACjD,IAAI,EAAE,QAAQ,CAAC;IAEf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,KAAK,sBAAsB,GAAG,oBAAoB,GAAG;IACnD,IAAI,EAAE,UAAU,CAAC;IAEjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;AAE3E,wBAAgB,SAAS,CAAC,EACxB,UAAU,EACV,KAAK,EACL,SAAS,EACT,SAAS,EACT,KAAK,EACL,WAAkB,EAClB,IAAI,EACJ,YAAY,EACZ,MAAM,GACP,EAAE,cAAc,2CAkDhB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Accordion as b, AccordionItem as t, AccordionTrigger as $, AccordionContent as v } from "../../ui/accordion.js";
|
|
4
|
+
import { useMakeTestId as p } from "../../../lib/hooks/useMakeTestId.js";
|
|
5
|
+
function T({
|
|
6
|
+
dataTestId: g,
|
|
7
|
+
theme: o,
|
|
8
|
+
ariaLabel: n,
|
|
9
|
+
className: l,
|
|
10
|
+
items: c,
|
|
11
|
+
collapsible: h = !0,
|
|
12
|
+
type: e,
|
|
13
|
+
defaultValue: i,
|
|
14
|
+
border: d
|
|
15
|
+
}) {
|
|
16
|
+
const s = p("Accordion", g);
|
|
17
|
+
return e === "single" ? /* @__PURE__ */ a(
|
|
18
|
+
b,
|
|
19
|
+
{
|
|
20
|
+
type: e,
|
|
21
|
+
defaultValue: i,
|
|
22
|
+
className: `${o} ${l} ${d ? "rounded-lg border p-2" : ""}`,
|
|
23
|
+
"aria-label": n,
|
|
24
|
+
collapsible: h,
|
|
25
|
+
children: c.map((r) => /* @__PURE__ */ u(
|
|
26
|
+
t,
|
|
27
|
+
{
|
|
28
|
+
value: r.value,
|
|
29
|
+
disabled: r.isDisabled ?? !1,
|
|
30
|
+
className: `${l} ${d ? "border-b !last:border-b-0" : ""}`,
|
|
31
|
+
"data-testid": s(r.value),
|
|
32
|
+
"aria-label": r.value,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ a($, { children: r.trigger }),
|
|
35
|
+
/* @__PURE__ */ a(v, { children: r.content })
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
r.value
|
|
39
|
+
))
|
|
40
|
+
}
|
|
41
|
+
) : /* @__PURE__ */ a(
|
|
42
|
+
b,
|
|
43
|
+
{
|
|
44
|
+
type: e,
|
|
45
|
+
defaultValue: i,
|
|
46
|
+
className: `${o} ${l} ${d ? "rounded-lg border p-2" : ""}`,
|
|
47
|
+
"aria-label": n,
|
|
48
|
+
children: c.map((r) => /* @__PURE__ */ u(
|
|
49
|
+
t,
|
|
50
|
+
{
|
|
51
|
+
value: r.value,
|
|
52
|
+
disabled: r.isDisabled ?? !1,
|
|
53
|
+
className: `${l} ${d ? "border-b !last:border-b-0" : ""}`,
|
|
54
|
+
"data-testid": s(r.value),
|
|
55
|
+
"aria-label": r.value,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ a($, { children: r.trigger }),
|
|
58
|
+
/* @__PURE__ */ a(v, { children: r.content })
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
r.value
|
|
62
|
+
))
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
T as Accordion
|
|
68
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { types, sizes } from '../../lib/buttonVariants';
|
|
2
|
+
import { BaseProps } from '../../lib/baseProps';
|
|
3
|
+
import { IconProps, IconKey } from '../../components/custom/icons/Icons';
|
|
4
|
+
type ButtonProps = BaseProps & {
|
|
5
|
+
variant: types;
|
|
6
|
+
size: sizes;
|
|
7
|
+
title: string;
|
|
8
|
+
leftIcon?: IconKey;
|
|
9
|
+
rightIcon?: IconKey;
|
|
10
|
+
leftIconProps?: IconProps;
|
|
11
|
+
rightIconProps?: IconProps;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function Button({ variant, size, title, leftIcon, rightIcon, leftIconProps, rightIconProps, dataTestId, onClick, theme, ariaLabel, className, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/stories/basic/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,OAAO,EAEb,MAAM,iCAAiC,CAAC;AAGzC,KAAK,WAAW,GAAG,SAAS,GAAG;IAC7B,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,OAAmB,EACnB,IAAgB,EAChB,KAAqB,EACrB,QAAiB,EACjB,SAAkB,EAClB,aAAa,EACb,cAAc,EACd,UAAU,EACV,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,GACV,EAAE,WAAW,2CAkCb"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as e, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { Button as x } from "../../ui/button.js";
|
|
3
|
+
import { iconMap as s } from "../icons/Icons.js";
|
|
4
|
+
import { useMakeTestId as g } from "../../../lib/hooks/useMakeTestId.js";
|
|
5
|
+
function b({
|
|
6
|
+
variant: f = "default",
|
|
7
|
+
size: u = "default",
|
|
8
|
+
title: c = "hello world",
|
|
9
|
+
leftIcon: h = "none",
|
|
10
|
+
rightIcon: m = "none",
|
|
11
|
+
leftIconProps: o,
|
|
12
|
+
rightIconProps: n,
|
|
13
|
+
dataTestId: v,
|
|
14
|
+
onClick: $,
|
|
15
|
+
theme: a,
|
|
16
|
+
ariaLabel: p,
|
|
17
|
+
className: i
|
|
18
|
+
}) {
|
|
19
|
+
const t = g("Button", v), d = s[h], l = s[m], r = o?.height !== void 0 || n?.height !== void 0;
|
|
20
|
+
return /* @__PURE__ */ e(
|
|
21
|
+
x,
|
|
22
|
+
{
|
|
23
|
+
className: `${i} ${a} clickable overflow-hidden ${r ? "h-auto" : ""}`,
|
|
24
|
+
variant: f,
|
|
25
|
+
size: r ? "default" : u,
|
|
26
|
+
"data-testid": t(),
|
|
27
|
+
"aria-label": p,
|
|
28
|
+
onClick: $,
|
|
29
|
+
children: /* @__PURE__ */ w(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: `flex flex-row gap-3 justify-center items-center overflow-hidden ${i} ${a}`,
|
|
33
|
+
"data-testid": t("Content"),
|
|
34
|
+
children: [
|
|
35
|
+
d ? /* @__PURE__ */ e(d, { ...o, dataTestId: t("Left") }) : null,
|
|
36
|
+
c,
|
|
37
|
+
l ? /* @__PURE__ */ e(l, { ...n, dataTestId: t("Right") }) : null
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
b as Button
|
|
46
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseProps } from '../../lib/baseProps';
|
|
2
|
+
export type inputType = "text" | "number" | "url" | "email" | "password" | "search";
|
|
3
|
+
type InputFieldProps = BaseProps & {
|
|
4
|
+
fieldLabel: React.ReactNode;
|
|
5
|
+
fieldPlaceholder: string;
|
|
6
|
+
fieldDescription: string;
|
|
7
|
+
leftNode?: React.ReactNode;
|
|
8
|
+
rightNode?: React.ReactNode;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
onBlur?: (value: string) => void;
|
|
13
|
+
onFocus?: (value: string) => void;
|
|
14
|
+
type: inputType;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isInvalid?: boolean;
|
|
17
|
+
isRequired?: boolean;
|
|
18
|
+
msg?: React.ReactNode | string;
|
|
19
|
+
};
|
|
20
|
+
export declare function InputField({ fieldLabel, fieldPlaceholder, fieldDescription, isDisabled, isInvalid, isRequired, msg, type, leftNode, rightNode, defaultValue, value, onChange, onBlur, onFocus, dataTestId, theme, className, }: InputFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/stories/basic/input.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,QAAQ,GACR,KAAK,GACL,OAAO,GACP,UAAU,GACV,QAAQ,CAAC;AAEb,KAAK,eAAe,GAAG,SAAS,GAAG;IACjC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;CAChC,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,UAAU,EACV,gBAAqB,EACrB,gBAAqB,EAErB,UAAkB,EAClB,SAAiB,EACjB,UAAkB,EAElB,GAAQ,EACR,IAAI,EAEJ,QAAQ,EACR,SAAS,EAET,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EAEP,UAAU,EACV,KAAK,EACL,SAAS,GACV,EAAE,eAAe,2CA8FjB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsxs as c, jsx as r, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { Input as B } from "../../ui/input.js";
|
|
3
|
+
import { useState as x, useRef as D, useEffect as G } from "react";
|
|
4
|
+
import { Field as L, FieldLabel as R, FieldDescription as S } from "../../ui/field.js";
|
|
5
|
+
import { useMakeTestId as q } from "../../../lib/hooks/useMakeTestId.js";
|
|
6
|
+
function O({
|
|
7
|
+
fieldLabel: n,
|
|
8
|
+
fieldPlaceholder: $ = "",
|
|
9
|
+
fieldDescription: F = "",
|
|
10
|
+
isDisabled: i = !1,
|
|
11
|
+
isInvalid: d = !1,
|
|
12
|
+
isRequired: u = !1,
|
|
13
|
+
msg: t = "",
|
|
14
|
+
type: b,
|
|
15
|
+
leftNode: p,
|
|
16
|
+
rightNode: f,
|
|
17
|
+
defaultValue: g,
|
|
18
|
+
value: m,
|
|
19
|
+
onChange: y,
|
|
20
|
+
onBlur: N,
|
|
21
|
+
onFocus: V,
|
|
22
|
+
dataTestId: j,
|
|
23
|
+
theme: o,
|
|
24
|
+
className: s
|
|
25
|
+
}) {
|
|
26
|
+
const v = m !== void 0, a = q("Field", j), [C, I] = x(g ?? ""), w = v ? m : C, M = (e) => {
|
|
27
|
+
v || I(e), y?.(e);
|
|
28
|
+
}, T = d ? "text-[var(--destructive)]" : "", l = D(t), [k, h] = x(!!t);
|
|
29
|
+
return G(() => {
|
|
30
|
+
t ? (l.current = t, h(!0)) : h(!1);
|
|
31
|
+
}, [t]), /* @__PURE__ */ c(
|
|
32
|
+
L,
|
|
33
|
+
{
|
|
34
|
+
"data-disabled": i,
|
|
35
|
+
"data-invalid": d,
|
|
36
|
+
orientation: "responsive",
|
|
37
|
+
"data-testid": a(),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ c(
|
|
40
|
+
R,
|
|
41
|
+
{
|
|
42
|
+
htmlFor: `input-${n}`,
|
|
43
|
+
className: `${s} ${o}`,
|
|
44
|
+
"data-testid": a("Label"),
|
|
45
|
+
children: [
|
|
46
|
+
n,
|
|
47
|
+
" ",
|
|
48
|
+
u ? /* @__PURE__ */ r("span", { className: "text-destructive", children: "*" }) : /* @__PURE__ */ r(E, {})
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ c(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: "flex flex-row border border-foreground justify-center items-center rounded-md !divide-x-2 overflow-hidden",
|
|
56
|
+
"data-testid": a("GroupDiv"),
|
|
57
|
+
children: [
|
|
58
|
+
p && /* @__PURE__ */ r("div", { className: "pr-1 pl-1", "data-testid": a("LeftNode"), children: p }),
|
|
59
|
+
/* @__PURE__ */ r(
|
|
60
|
+
B,
|
|
61
|
+
{
|
|
62
|
+
id: `input-${n}`,
|
|
63
|
+
type: b,
|
|
64
|
+
placeholder: $,
|
|
65
|
+
className: `${s} ${o} rounded-none border-0`,
|
|
66
|
+
disabled: i,
|
|
67
|
+
"aria-invalid": d,
|
|
68
|
+
required: u,
|
|
69
|
+
value: w,
|
|
70
|
+
onBlur: (e) => N?.(e.target.value),
|
|
71
|
+
onFocus: (e) => V?.(e.target.value),
|
|
72
|
+
onChange: (e) => M(e.target.value),
|
|
73
|
+
"data-testid": a("Input")
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
f && /* @__PURE__ */ r("div", { className: "pr-1 pl-1", "data-testid": a("RightNode"), children: f })
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ r(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: `transition-all duration-500 ease-out overflow-hidden ${k ? "opacity-100 translate-y-0 max-h-20" : "opacity-0 -translate-y-2 pointer-events-none max-h-0"} ${T}`,
|
|
84
|
+
onTransitionEnd: () => {
|
|
85
|
+
t || (l.current = "");
|
|
86
|
+
},
|
|
87
|
+
// eslint-disable-next-line react-hooks/refs
|
|
88
|
+
children: t ?? l.current
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ r(
|
|
92
|
+
S,
|
|
93
|
+
{
|
|
94
|
+
className: `flex flex-col justify-start gap-2 ${s} ${o}`,
|
|
95
|
+
"data-disabled": i,
|
|
96
|
+
"data-testid": a("Description"),
|
|
97
|
+
children: F
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
O as InputField
|
|
106
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseProps } from '../../lib/baseProps';
|
|
2
|
+
export type Item = {
|
|
3
|
+
id: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export type Size = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
7
|
+
type SelectProps = BaseProps & {
|
|
8
|
+
placeholder: string;
|
|
9
|
+
items: Item[];
|
|
10
|
+
isDisabled: boolean;
|
|
11
|
+
value?: string;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
onValueChange?: (value: string) => void;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function Select({ placeholder, items, theme, dataTestId, className, value, defaultValue, isDisabled, onValueChange, onOpenChange, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/stories/basic/select.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAE5D,KAAK,WAAW,GAAG,SAAS,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,WAAW,EACX,KAAU,EACV,KAAK,EACL,UAAU,EACV,SAAS,EAET,KAAK,EACL,YAAY,EACZ,UAAkB,EAElB,aAAa,EACb,YAAY,GACb,EAAE,WAAW,2CAgDb"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Select as v, SelectTrigger as C, SelectValue as I, SelectContent as V, SelectItem as T } from "../../ui/select.js";
|
|
3
|
+
import { useState as w } from "react";
|
|
4
|
+
import { useMakeTestId as x } from "../../../lib/hooks/useMakeTestId.js";
|
|
5
|
+
function N({
|
|
6
|
+
placeholder: r,
|
|
7
|
+
items: s = [],
|
|
8
|
+
theme: t,
|
|
9
|
+
dataTestId: i,
|
|
10
|
+
className: a,
|
|
11
|
+
value: o,
|
|
12
|
+
defaultValue: c,
|
|
13
|
+
isDisabled: u = !1,
|
|
14
|
+
onValueChange: $,
|
|
15
|
+
onOpenChange: f
|
|
16
|
+
}) {
|
|
17
|
+
const l = x("Select", i), [S, p] = w(c ?? ""), d = o !== void 0, g = d ? o : S, h = (e) => {
|
|
18
|
+
d || p(e), $?.(e);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ m(
|
|
21
|
+
v,
|
|
22
|
+
{
|
|
23
|
+
"data-testid": l(),
|
|
24
|
+
value: g,
|
|
25
|
+
onValueChange: (e) => h(e),
|
|
26
|
+
onOpenChange: (e) => f?.(e),
|
|
27
|
+
disabled: u,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ n(
|
|
30
|
+
C,
|
|
31
|
+
{
|
|
32
|
+
className: `w-[180px] ${t} ${a} overflow-hidden`,
|
|
33
|
+
"data-testid": l("Trigger"),
|
|
34
|
+
children: /* @__PURE__ */ n(
|
|
35
|
+
I,
|
|
36
|
+
{
|
|
37
|
+
className: `${t} ${`${a}`}
|
|
38
|
+
overflow-hidden`,
|
|
39
|
+
placeholder: r
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ n(
|
|
45
|
+
V,
|
|
46
|
+
{
|
|
47
|
+
className: `${t} ${a}`,
|
|
48
|
+
"data-testid": l("Content"),
|
|
49
|
+
children: s.map((e) => /* @__PURE__ */ n(
|
|
50
|
+
T,
|
|
51
|
+
{
|
|
52
|
+
value: e.value,
|
|
53
|
+
className: `${t} ${a}`,
|
|
54
|
+
"data-testid": l(`Item-${e.id}`),
|
|
55
|
+
children: e.value
|
|
56
|
+
},
|
|
57
|
+
e.id
|
|
58
|
+
))
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
N as Select
|
|
67
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseProps } from '../../lib/baseProps';
|
|
2
|
+
export type DefaultValue = {
|
|
3
|
+
left: number;
|
|
4
|
+
right?: number;
|
|
5
|
+
};
|
|
6
|
+
export type SliderProps = BaseProps & {
|
|
7
|
+
defaultValue: DefaultValue;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
onChange?: (value: number[]) => void;
|
|
11
|
+
onFocus?: (value: number[]) => void;
|
|
12
|
+
onBlur?: (value: number[]) => void;
|
|
13
|
+
value?: number[];
|
|
14
|
+
thumbClassname?: string;
|
|
15
|
+
rangeClassname?: string;
|
|
16
|
+
tooltip?: boolean;
|
|
17
|
+
tooltipClassname?: string;
|
|
18
|
+
valuePrefix?: string;
|
|
19
|
+
valueSuffix?: string;
|
|
20
|
+
isInvalid?: boolean;
|
|
21
|
+
isDisabled?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare function Slider({ dataTestId, theme, ariaLabel, className, defaultValue, max, step, onChange, onFocus, onBlur, value, thumbClassname: thumbClassName, rangeClassname: rangeClassName, tooltip, tooltipClassname, valuePrefix, valueSuffix, isDisabled, isInvalid, }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/stories/basic/slider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,UAAU,EACV,KAAK,EACL,SAAS,EACT,SAAS,EAET,YAA0B,EAC1B,GAAS,EACT,IAAQ,EAER,QAAQ,EACR,OAAO,EACP,MAAM,EACN,KAAK,EAEL,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAE9B,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,WAAW,EAEX,UAAkB,EAClB,SAAiB,GAClB,EAAE,WAAW,2CAsCb"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as F } from "react/jsx-runtime";
|
|
2
|
+
import { Slider as I } from "../../ui/slider.js";
|
|
3
|
+
import { useState as N } from "react";
|
|
4
|
+
function w({
|
|
5
|
+
dataTestId: o,
|
|
6
|
+
theme: r,
|
|
7
|
+
ariaLabel: i,
|
|
8
|
+
className: f,
|
|
9
|
+
defaultValue: e = { left: 0 },
|
|
10
|
+
max: m = 100,
|
|
11
|
+
step: d = 1,
|
|
12
|
+
onChange: c,
|
|
13
|
+
onFocus: u,
|
|
14
|
+
onBlur: g,
|
|
15
|
+
value: t,
|
|
16
|
+
thumbClassname: h,
|
|
17
|
+
rangeClassname: C,
|
|
18
|
+
tooltip: p,
|
|
19
|
+
tooltipClassname: x,
|
|
20
|
+
valuePrefix: S,
|
|
21
|
+
valueSuffix: b,
|
|
22
|
+
isDisabled: l = !1,
|
|
23
|
+
isInvalid: $ = !1
|
|
24
|
+
}) {
|
|
25
|
+
const v = t !== void 0, s = e.right === void 0 ? [e.left] : [e.left, e.right], [n, V] = N(s), j = v ? t : n, B = (a) => {
|
|
26
|
+
V(a), c?.(a);
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ F(
|
|
29
|
+
I,
|
|
30
|
+
{
|
|
31
|
+
defaultValue: s,
|
|
32
|
+
max: m,
|
|
33
|
+
step: d,
|
|
34
|
+
"data-testid": o,
|
|
35
|
+
"aria-label": i,
|
|
36
|
+
className: `${r} ${f}`,
|
|
37
|
+
onValueChange: (a) => B(a),
|
|
38
|
+
onFocus: () => u?.(n),
|
|
39
|
+
onBlur: () => g?.(n),
|
|
40
|
+
value: j,
|
|
41
|
+
thumbClassname: h,
|
|
42
|
+
rangeClassname: C,
|
|
43
|
+
disabled: l,
|
|
44
|
+
invalid: $,
|
|
45
|
+
tooltip: l ? !1 : p,
|
|
46
|
+
tooltipClassname: x,
|
|
47
|
+
prefix: S,
|
|
48
|
+
suffix: b
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
w as Slider
|
|
54
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseProps } from '../../lib/baseProps';
|
|
2
|
+
export type SwitchFieldProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
description: string;
|
|
5
|
+
onChange?: (value: boolean) => void;
|
|
6
|
+
onBlur?: (value: boolean) => void;
|
|
7
|
+
onFocus?: (value: boolean) => void;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
switchId: string;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
isInvalid?: boolean;
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
size?: "sm" | "default";
|
|
15
|
+
};
|
|
16
|
+
export declare function SwitchField({ theme, dataTestId, className, ariaLabel, onChange, onBlur, onFocus, defaultValue, value, label, description, switchId, isDisabled, isInvalid, isRequired, size, }: BaseProps & SwitchFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/stories/basic/switch.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,UAAU,EACV,SAAS,EACT,SAAS,EAET,QAAQ,EACR,MAAM,EACN,OAAO,EAEP,YAAY,EACZ,KAAK,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EAER,UAAU,EACV,SAAS,EACT,UAAU,EAEV,IAAI,GACL,EAAE,SAAS,GAAG,gBAAgB,2CA2E9B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsxs as l, jsx as o, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { Field as V, FieldContent as E, FieldLabel as N, FieldDescription as T } from "../../ui/field.js";
|
|
3
|
+
import { Switch as y } from "../../ui/switch.js";
|
|
4
|
+
import { useMakeTestId as z } from "../../../lib/hooks/useMakeTestId.js";
|
|
5
|
+
import { useState as A } from "react";
|
|
6
|
+
function H({
|
|
7
|
+
theme: d,
|
|
8
|
+
dataTestId: h,
|
|
9
|
+
className: r,
|
|
10
|
+
ariaLabel: c,
|
|
11
|
+
onChange: $,
|
|
12
|
+
onBlur: g,
|
|
13
|
+
onFocus: p,
|
|
14
|
+
defaultValue: v,
|
|
15
|
+
value: m,
|
|
16
|
+
label: x,
|
|
17
|
+
description: F,
|
|
18
|
+
switchId: u,
|
|
19
|
+
isDisabled: e,
|
|
20
|
+
isInvalid: t,
|
|
21
|
+
isRequired: b,
|
|
22
|
+
size: C
|
|
23
|
+
}) {
|
|
24
|
+
const a = z("Field", h), [s, k] = A(
|
|
25
|
+
(v ?? "off") === "on"
|
|
26
|
+
), n = m !== void 0, i = n ? m === "on" : s, w = (S) => {
|
|
27
|
+
const f = S.target.value === "on";
|
|
28
|
+
n || k(f), $?.(f);
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ l(
|
|
31
|
+
V,
|
|
32
|
+
{
|
|
33
|
+
orientation: "horizontal",
|
|
34
|
+
className: `max-w-sm flex flex-row justify-stretch !items-center
|
|
35
|
+
${r} ${d}`,
|
|
36
|
+
"data-testid": a(),
|
|
37
|
+
"aria-label": c,
|
|
38
|
+
"data-disabled": e,
|
|
39
|
+
"data-invalid": t,
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ l(
|
|
42
|
+
E,
|
|
43
|
+
{
|
|
44
|
+
"data-testid": a("Content"),
|
|
45
|
+
"data-disabled": e,
|
|
46
|
+
"data-invalid": t,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ l(
|
|
49
|
+
N,
|
|
50
|
+
{
|
|
51
|
+
htmlFor: u,
|
|
52
|
+
"data-testid": a("Label"),
|
|
53
|
+
className: `${r} ${d}`,
|
|
54
|
+
"data-disabled": e,
|
|
55
|
+
"data-invalid": t,
|
|
56
|
+
children: [
|
|
57
|
+
x,
|
|
58
|
+
" ",
|
|
59
|
+
b ? /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" }) : /* @__PURE__ */ o(j, {})
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ o(
|
|
64
|
+
T,
|
|
65
|
+
{
|
|
66
|
+
"data-testid": a("Description"),
|
|
67
|
+
className: `${t ? "text-[var(--destructive)]" : ""}
|
|
68
|
+
${r} ${d}`,
|
|
69
|
+
"data-disabled": e,
|
|
70
|
+
"data-invalid": t,
|
|
71
|
+
children: F
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ o(
|
|
78
|
+
y,
|
|
79
|
+
{
|
|
80
|
+
className: `${e ? "!bg-[var(--muted)]" : ""}
|
|
81
|
+
${t ? "!bg-[var(--destructive)]" : ""}
|
|
82
|
+
${r} ${d}`,
|
|
83
|
+
id: u,
|
|
84
|
+
"data-testid": a("SwitchElement"),
|
|
85
|
+
"aria-label": c + "-ActiveElement",
|
|
86
|
+
onChange: w,
|
|
87
|
+
onBlur: () => g?.(i),
|
|
88
|
+
onFocus: () => p?.(i),
|
|
89
|
+
"data-disabled": e,
|
|
90
|
+
"data-invalid": t,
|
|
91
|
+
"aria-disabled": e,
|
|
92
|
+
"aria-invalid": t,
|
|
93
|
+
...n ? { checked: i } : { defaultChecked: s },
|
|
94
|
+
size: C,
|
|
95
|
+
thumbColor: `${t ? "!bg-[var(--destructive-foreground)]" : ""}
|
|
96
|
+
${e ? "!bg-[var(--muted-foreground)]" : ""}`
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
H as SwitchField
|
|
105
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
import { BaseProps } from '../../lib/baseProps';
|
|
3
|
+
type TableProps<TData, TValue> = BaseProps & {
|
|
4
|
+
columns: ColumnDef<TData, TValue>[];
|
|
5
|
+
data: TData[];
|
|
6
|
+
};
|
|
7
|
+
export declare function Table<TData, TValue>({ theme, ariaLabel, className, dataTestId, columns, data, }: TableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/stories/basic/table.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,uBAAuB,CAAC;AAW/B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,KAAK,UAAU,CAAC,KAAK,EAAE,MAAM,IAAI,SAAS,GAAG;IAC3C,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;IACpC,IAAI,EAAE,KAAK,EAAE,CAAC;CACf,CAAC;AAEF,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,EACnC,KAAK,EACL,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,IAAI,GACL,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,2CAyE3B"}
|