@mp-front/components 0.0.1-next-2 → 0.0.1-next-4
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 +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/toggle/constants/variants.d.ts +18 -0
- package/dist/components/toggle/constants/variants.d.ts.map +1 -0
- package/dist/components/toggle/index.d.ts +3 -0
- package/dist/components/toggle/index.d.ts.map +1 -0
- package/dist/components/toggle/toggle.component.d.ts +27 -0
- package/dist/components/toggle/toggle.component.d.ts.map +1 -0
- package/dist/components/toggle/toggle.stories.d.ts +15 -0
- package/dist/components/toggle/toggle.stories.d.ts.map +1 -0
- package/dist/components/toggle/toggle.test.d.ts +2 -0
- package/dist/components/toggle/toggle.test.d.ts.map +1 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/toggle-group/index.d.ts.map +1 -0
- package/dist/components/toggle-group/toggle-group-context.d.ts +22 -0
- package/dist/components/toggle-group/toggle-group-context.d.ts.map +1 -0
- package/dist/components/toggle-group/toggle-group-item.component.d.ts +28 -0
- package/dist/components/toggle-group/toggle-group-item.component.d.ts.map +1 -0
- package/dist/components/toggle-group/toggle-group.component.d.ts +37 -0
- package/dist/components/toggle-group/toggle-group.component.d.ts.map +1 -0
- package/dist/components/toggle-group/toggle-group.stories.d.ts +16 -0
- package/dist/components/toggle-group/toggle-group.stories.d.ts.map +1 -0
- package/dist/components/toggle-group/toggle-group.test.d.ts +2 -0
- package/dist/components/toggle-group/toggle-group.test.d.ts.map +1 -0
- package/dist/index-BP9HuXkV.cjs +31 -0
- package/dist/index-C0ENqrRs.js +570 -0
- package/dist/{index-CcUNk-y0.js → index-C3AiNKcY.js} +2 -1
- package/dist/{index-B2DyV2Jl.cjs → index-Dm9rKIx2.cjs} +1 -1
- package/dist/layout/content.component.d.ts +19 -0
- package/dist/layout/content.component.d.ts.map +1 -0
- package/dist/layout/footer.component.d.ts +17 -0
- package/dist/layout/footer.component.d.ts.map +1 -0
- package/dist/layout/header/header.component.d.ts +33 -0
- package/dist/layout/header/header.component.d.ts.map +1 -0
- package/dist/layout/header/header.types.d.ts +30 -0
- package/dist/layout/header/header.types.d.ts.map +1 -0
- package/dist/layout/header/left-side.component.d.ts +19 -0
- package/dist/layout/header/left-side.component.d.ts.map +1 -0
- package/dist/layout/header/right-side.component.d.ts +27 -0
- package/dist/layout/header/right-side.component.d.ts.map +1 -0
- package/dist/layout/header/store.component.d.ts +20 -0
- package/dist/layout/header/store.component.d.ts.map +1 -0
- package/dist/layout/header/user.component.d.ts +27 -0
- package/dist/layout/header/user.component.d.ts.map +1 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/root-layout.component.d.ts +46 -0
- package/dist/layout/root-layout.component.d.ts.map +1 -0
- package/dist/layout/root-layout.stories.d.ts +12 -0
- package/dist/layout/root-layout.stories.d.ts.map +1 -0
- package/dist/layout/root-layout.test.d.ts +2 -0
- package/dist/layout/root-layout.test.d.ts.map +1 -0
- package/dist/layout/root-layout.types.d.ts +10 -0
- package/dist/layout/root-layout.types.d.ts.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/ui-components-hooks.cjs +1 -1
- package/dist/ui-components-hooks.js +29 -170
- package/dist/ui-components-index.cjs +34 -64
- package/dist/ui-components-index.js +6877 -7154
- package/dist/ui-components-layout.cjs +135 -0
- package/dist/ui-components-layout.js +20094 -0
- package/dist/ui-components-utils.cjs +1 -1
- package/dist/ui-components-utils.js +1 -1
- package/dist/useTranslation-Cenukg7h.js +147 -0
- package/dist/useTranslation-CnSCmJou.cjs +1 -0
- package/package.json +7 -18
|
@@ -35,4 +35,6 @@ export { default as Tooltip } from './tooltip/tooltip.component';
|
|
|
35
35
|
export { default as Typography } from './typography';
|
|
36
36
|
export { default as Row } from './grid/row/row.component';
|
|
37
37
|
export { default as Col } from './grid/col/col.component';
|
|
38
|
+
export { default as Toggle } from './toggle/toggle.component';
|
|
39
|
+
export { default as ToggleGroup } from './toggle-group/toggle-group.component';
|
|
38
40
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAA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18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variantes de estilos para el componente Toggle.
|
|
3
|
+
* Define las clases CSS y variantes disponibles para personalizar la apariencia del toggle.
|
|
4
|
+
*
|
|
5
|
+
* @returns {VariantProps} Función CVA con variantes de tamaño y estilo
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { toggleVariants } from 'mp-ui-components'
|
|
10
|
+
*
|
|
11
|
+
* const className = toggleVariants({ variant: 'outline', size: 'sm' })
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const toggleVariants: (props?: {
|
|
15
|
+
variant?: "outline" | "default";
|
|
16
|
+
size?: "sm" | "lg" | "default";
|
|
17
|
+
} & import('class-variance-authority/types').ClassProp) => string;
|
|
18
|
+
//# sourceMappingURL=variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/toggle/constants/variants.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc;;;iEAmB1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Toggle as TogglePrimitive } from 'radix-ui';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
import { toggleVariants } from './constants/variants';
|
|
5
|
+
/**
|
|
6
|
+
* Componente Toggle que permite alternar entre estados activado/desactivado.
|
|
7
|
+
* Basado en Radix UI Toggle con variantes de estilo personalizables.
|
|
8
|
+
*
|
|
9
|
+
* @param {ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>} props - Propiedades del componente
|
|
10
|
+
* @param {string} props.className - Clases CSS adicionales para personalizar el estilo
|
|
11
|
+
* @param {"default" | "outline"} props.variant - Variante de estilo del toggle (default: "default")
|
|
12
|
+
* @param {"default" | "sm" | "lg"} props.size - Tamaño del toggle (default: "default")
|
|
13
|
+
*
|
|
14
|
+
* @returns {JSX.Element} Elemento Toggle renderizado
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { Toggle } from 'mp-ui-components'
|
|
19
|
+
*
|
|
20
|
+
* <Toggle variant="outline" size="sm">
|
|
21
|
+
* <IconBold />
|
|
22
|
+
* </Toggle>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const Toggle: ({ className, variant, size, ...props }: ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default Toggle;
|
|
27
|
+
//# sourceMappingURL=toggle.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle/toggle.component.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,MAAM,2CAKT,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAC5C,YAAY,CAAC,OAAO,cAAc,CAAC,4CAQpC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Toggle } from './toggle.component';
|
|
3
|
+
declare const meta: Meta<typeof Toggle>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Outline: Story;
|
|
8
|
+
export declare const Small: Story;
|
|
9
|
+
export declare const Large: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
export declare const OutlineSmall: Story;
|
|
12
|
+
export declare const OutlineLarge: Story;
|
|
13
|
+
export declare const Group: Story;
|
|
14
|
+
export declare const OutlineGroup: Story;
|
|
15
|
+
//# sourceMappingURL=toggle.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.stories.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle/toggle.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAEvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CA0B7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAQ1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.test.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle/toggle.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* Contexto para compartir configuración entre componentes ToggleGroup y ToggleGroupItem.
|
|
4
|
+
* Proporciona variantes de estilo, espaciado y orientación a todos los items del grupo.
|
|
5
|
+
*
|
|
6
|
+
* @type {React.Context<VariantProps<typeof toggleVariants> & { spacing?: number; orientation?: "horizontal" | "vertical" }>}
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { ToggleGroupContext } from '@/components/toggle-group/toggle-group-context'
|
|
11
|
+
*
|
|
12
|
+
* const context = useContext(ToggleGroupContext)
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const ToggleGroupContext: import('react').Context<VariantProps<(props?: {
|
|
16
|
+
variant?: "outline" | "default";
|
|
17
|
+
size?: "sm" | "lg" | "default";
|
|
18
|
+
} & import('class-variance-authority/types').ClassProp) => string> & {
|
|
19
|
+
spacing?: number;
|
|
20
|
+
orientation?: "horizontal" | "vertical";
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=toggle-group-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group-context.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle-group/toggle-group-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIvD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB;;;;cAEjB,MAAM;kBACF,YAAY,GAAG,UAAU;EAOzC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
|
|
3
|
+
import { toggleVariants } from '../toggle';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
/**
|
|
6
|
+
* Item individual dentro de un ToggleGroup.
|
|
7
|
+
* Hereda automáticamente las variantes y configuración del grupo padre mediante contexto.
|
|
8
|
+
*
|
|
9
|
+
* @param {ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>} props - Propiedades del componente
|
|
10
|
+
* @param {string} props.className - Clases CSS adicionales
|
|
11
|
+
* @param {React.ReactNode} props.children - Contenido del item
|
|
12
|
+
* @param {"default" | "outline"} props.variant - Variante de estilo (default: "default", heredado del grupo si existe)
|
|
13
|
+
* @param {"default" | "sm" | "lg"} props.size - Tamaño del item (default: "default", heredado del grupo si existe)
|
|
14
|
+
*
|
|
15
|
+
* @returns {JSX.Element} Elemento ToggleGroupItem renderizado
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { ToggleGroup } from 'mp-ui-components'
|
|
20
|
+
*
|
|
21
|
+
* <ToggleGroup.Item value="bold">
|
|
22
|
+
* <IconBold />
|
|
23
|
+
* </ToggleGroup.Item>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare const ToggleGroupItem: ({ className, children, variant, size, ...props }: ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default ToggleGroupItem;
|
|
28
|
+
//# sourceMappingURL=toggle-group-item.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group-item.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle-group/toggle-group-item.component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGvD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,eAAe,qDAMlB,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACjD,YAAY,CAAC,OAAO,cAAc,CAAC,4CAsBpC,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
|
|
3
|
+
import { toggleVariants } from '../toggle';
|
|
4
|
+
import { ComponentProps } from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* Componente ToggleGroup que agrupa múltiples toggles con selección única o múltiple.
|
|
7
|
+
* Basado en Radix UI ToggleGroup con soporte para orientación horizontal/vertical y espaciado personalizable.
|
|
8
|
+
*
|
|
9
|
+
* @param {ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>} props - Propiedades del componente
|
|
10
|
+
* @param {string} props.className - Clases CSS adicionales
|
|
11
|
+
* @param {"default" | "outline"} props.variant - Variante de estilo aplicada a todos los items
|
|
12
|
+
* @param {"default" | "sm" | "lg"} props.size - Tamaño aplicado a todos los items
|
|
13
|
+
* @param {number} props.spacing - Espaciado entre items en píxeles (default: 0)
|
|
14
|
+
* @param {"horizontal" | "vertical"} props.orientation - Orientación del grupo (default: "horizontal")
|
|
15
|
+
* @param {React.ReactNode} props.children - Items del grupo (ToggleGroup.Item)
|
|
16
|
+
*
|
|
17
|
+
* @returns {JSX.Element} Elemento ToggleGroup renderizado
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* import { ToggleGroup } from 'mp-ui-components'
|
|
22
|
+
*
|
|
23
|
+
* <ToggleGroup type="single" variant="outline" spacing={4}>
|
|
24
|
+
* <ToggleGroup.Item value="bold">Bold</ToggleGroup.Item>
|
|
25
|
+
* <ToggleGroup.Item value="italic">Italic</ToggleGroup.Item>
|
|
26
|
+
* </ToggleGroup>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare const ToggleGroup: {
|
|
30
|
+
({ className, variant, size, spacing, orientation, children, ...props }: ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & {
|
|
31
|
+
spacing?: number;
|
|
32
|
+
orientation?: "horizontal" | "vertical";
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
Item: ({ className, children, variant, size, ...props }: ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
};
|
|
36
|
+
export default ToggleGroup;
|
|
37
|
+
//# sourceMappingURL=toggle-group.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle-group/toggle-group.component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAA;AAGrD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,QAAA,MAAM,WAAW;6EAQd,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACjD,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;QACpC,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;KACxC;mFAtBO,qBAEF,IAAI;CA0CX,CAAA;AAID,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as ToggleGroup } from './toggle-group.component';
|
|
3
|
+
declare const meta: Meta<typeof ToggleGroup>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ToggleGroup>;
|
|
6
|
+
export declare const Single: Story;
|
|
7
|
+
export declare const Multiple: Story;
|
|
8
|
+
export declare const Outline: Story;
|
|
9
|
+
export declare const WithSpacing: Story;
|
|
10
|
+
export declare const Small: Story;
|
|
11
|
+
export declare const Large: Story;
|
|
12
|
+
export declare const Vertical: Story;
|
|
13
|
+
export declare const VerticalWithSpacing: Story;
|
|
14
|
+
export declare const Disabled: Story;
|
|
15
|
+
export declare const OutlineVertical: Story;
|
|
16
|
+
//# sourceMappingURL=toggle-group.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.stories.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle-group/toggle-group.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,WAAW,MAAM,0BAA0B,CAAA;AAElD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAqClC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEzC,eAAO,MAAM,MAAM,EAAE,KAQpB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAQtB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAQtB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAQjC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAQtB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAa7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.test.d.ts","sourceRoot":"","sources":["../../../src/lib/components/toggle-group/toggle-group.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";const _e=require("react"),Se=require("react-dom");function Ce(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const u in o)if(u!=="default"){const s=Object.getOwnPropertyDescriptor(o,u);Object.defineProperty(n,u,s.get?s:{enumerable:!0,get:()=>o[u]})}}return n.default=o,Object.freeze(n)}const E=Ce(_e),$e=Ce(Se);var P={exports:{}},O={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var be;function We(){if(be)return O;be=1;var o=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function u(s,a,c){var d=null;if(c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),"key"in a){c={};for(var v in a)v!=="key"&&(c[v]=a[v])}else c=a;return a=c.ref,{$$typeof:o,type:s,key:d,ref:a!==void 0?a:null,props:c}}return O.Fragment=n,O.jsx=u,O.jsxs=u,O}var N={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ge;function Ve(){return ge||(ge=1,process.env.NODE_ENV!=="production"&&(function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case Ae:return"Portal";case ee:return"Profiler";case K:return"StrictMode";case U:return"Suspense";case q:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case te:return(e.displayName||"Context")+".Provider";case re:return(e._context.displayName||"Context")+".Consumer";case V:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return r=e.displayName||null,r!==null?r:o(e.type)||"Memo";case J:r=e._payload,e=e._init;try{return o(e(r))}catch{}}return null}function n(e){return""+e}function u(e){try{n(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,i=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),n(e)}}function s(){}function a(){if(w===0){ae=console.log,le=console.info,ue=console.warn,se=console.error,ie=console.group,ce=console.groupCollapsed,fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:s,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}w++}function c(){if(w--,w===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},e,{value:ae}),info:C({},e,{value:le}),warn:C({},e,{value:ue}),error:C({},e,{value:se}),group:C({},e,{value:ie}),groupCollapsed:C({},e,{value:ce}),groupEnd:C({},e,{value:fe})})}0>w&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function d(e){if(L===void 0)try{throw Error()}catch(t){var r=t.stack.trim().match(/\n( *(at )?)/);L=r&&r[1]||"",de=-1<t.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<t.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+L+e+de}function v(e,r){if(!e||B)return"";var t=G.get(e);if(t!==void 0)return t;B=!0,t=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var i=null;i=S.H,S.H=null,a();try{var m={DetermineComponentFrameRoot:function(){try{if(r){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(R){var k=R}Reflect.construct(e,[],_)}else{try{_.call()}catch(R){k=R}e.call(_.prototype)}}else{try{throw Error()}catch(R){k=R}(_=e())&&typeof _.catch=="function"&&_.catch(function(){})}}catch(R){if(R&&k&&typeof R.stack=="string")return[R.stack,k.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var l=m.DetermineComponentFrameRoot(),y=l[0],T=l[1];if(y&&T){var p=y.split(`
|
|
20
|
+
`),h=T.split(`
|
|
21
|
+
`);for(l=f=0;f<p.length&&!p[f].includes("DetermineComponentFrameRoot");)f++;for(;l<h.length&&!h[l].includes("DetermineComponentFrameRoot");)l++;if(f===p.length||l===h.length)for(f=p.length-1,l=h.length-1;1<=f&&0<=l&&p[f]!==h[l];)l--;for(;1<=f&&0<=l;f--,l--)if(p[f]!==h[l]){if(f!==1||l!==1)do if(f--,l--,0>l||p[f]!==h[l]){var j=`
|
|
22
|
+
`+p[f].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,j),j}while(1<=f&&0<=l);break}}}finally{B=!1,S.H=i,c(),Error.prepareStackTrace=t}return p=(p=e?e.displayName||e.name:"")?d(p):"",typeof e=="function"&&G.set(e,p),p}function b(e){if(e==null)return"";if(typeof e=="function"){var r=e.prototype;return v(e,!(!r||!r.isReactComponent))}if(typeof e=="string")return d(e);switch(e){case U:return d("Suspense");case q:return d("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case V:return e=v(e.render,!1),e;case z:return b(e.type);case J:r=e._payload,e=e._init;try{return b(e(r))}catch{}}return""}function g(){var e=S.A;return e===null?null:e.getOwner()}function M(e){if(ne.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function A(e,r){function t(){ve||(ve=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function we(){var e=o(this.type);return Ee[e]||(Ee[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function je(e,r,t,i,m,f){return t=f.ref,e={$$typeof:$,type:e,key:r,props:f,_owner:m},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:we}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function Z(e,r,t,i,m,f){if(typeof e=="string"||typeof e=="function"||e===W||e===ee||e===K||e===U||e===q||e===ke||typeof e=="object"&&e!==null&&(e.$$typeof===J||e.$$typeof===z||e.$$typeof===te||e.$$typeof===re||e.$$typeof===V||e.$$typeof===Me||e.getModuleId!==void 0)){var l=r.children;if(l!==void 0)if(i)if(H(l)){for(i=0;i<l.length;i++)D(l[i],e);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else D(l,e)}else l="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(l+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?i="null":H(e)?i="array":e!==void 0&&e.$$typeof===$?(i="<"+(o(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):i=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",i,l);if(ne.call(r,"key")){l=o(e);var y=Object.keys(r).filter(function(p){return p!=="key"});i=0<y.length?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}",me[l+i]||(y=0<y.length?"{"+y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
|
+
let props = %s;
|
|
24
|
+
<%s {...props} />
|
|
25
|
+
React keys must be passed directly to JSX without using spread:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s key={someKey} {...props} />`,i,l,y,l),me[l+i]=!0)}if(l=null,t!==void 0&&(u(t),l=""+t),M(r)&&(u(r.key),l=""+r.key),"key"in r){t={};for(var T in r)T!=="key"&&(t[T]=r[T])}else t=r;return l&&A(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),je(e,l,f,m,g(),t)}function D(e,r){if(typeof e=="object"&&e&&e.$$typeof!==Ye){if(H(e))for(var t=0;t<e.length;t++){var i=e[t];Y(i)&&Q(i,r)}else if(Y(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?t=null:(t=oe&&e[oe]||e["@@iterator"],t=typeof t=="function"?t:null),typeof t=="function"&&t!==e.entries&&(t=t.call(e),t!==e))for(;!(e=t.next()).done;)Y(e.value)&&Q(e.value,r)}}function Y(e){return typeof e=="object"&&e!==null&&e.$$typeof===$}function Q(e,r){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,r=Oe(r),!pe[r])){pe[r]=!0;var t="";e&&e._owner!=null&&e._owner!==g()&&(t=null,typeof e._owner.tag=="number"?t=o(e._owner.type):typeof e._owner.name=="string"&&(t=e._owner.name),t=" It was passed a child from "+t+".");var i=S.getCurrentStack;S.getCurrentStack=function(){var m=b(e.type);return i&&(m+=i()||""),m},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',r,t),S.getCurrentStack=i}}function Oe(e){var r="",t=g();return t&&(t=o(t.type))&&(r=`
|
|
28
|
+
|
|
29
|
+
Check the render method of \``+t+"`."),r||(e=o(e))&&(r=`
|
|
30
|
+
|
|
31
|
+
Check the top-level render call using <`+e+">."),r}var Ne=_e,$=Symbol.for("react.transitional.element"),Ae=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),K=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),re=Symbol.for("react.consumer"),te=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),ke=Symbol.for("react.offscreen"),oe=Symbol.iterator,Pe=Symbol.for("react.client.reference"),S=Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=Object.prototype.hasOwnProperty,C=Object.assign,Me=Symbol.for("react.client.reference"),H=Array.isArray,w=0,ae,le,ue,se,ie,ce,fe;s.__reactDisabledLog=!0;var L,de,B=!1,G=new(typeof WeakMap=="function"?WeakMap:Map),Ye=Symbol.for("react.client.reference"),ve,Ee={},me={},pe={};N.Fragment=W,N.jsx=function(e,r,t,i,m){return Z(e,r,t,!1,i,m)},N.jsxs=function(e,r,t,i,m){return Z(e,r,t,!0,i,m)}})()),N}var ye;function Ue(){return ye||(ye=1,process.env.NODE_ENV==="production"?P.exports=We():P.exports=Ve()),P.exports}var x=Ue();function Re(o,n){if(typeof o=="function")return o(n);o!=null&&(o.current=n)}function I(...o){return n=>{let u=!1;const s=o.map(a=>{const c=Re(a,n);return!u&&typeof c=="function"&&(u=!0),c});if(u)return()=>{for(let a=0;a<s.length;a++){const c=s[a];typeof c=="function"?c():Re(o[a],null)}}}}function qe(...o){return E.useCallback(I(...o),o)}function F(o){const n=Je(o),u=E.forwardRef((s,a)=>{const{children:c,...d}=s,v=E.Children.toArray(c),b=v.find(Le);if(b){const g=b.props.children,M=v.map(A=>A===b?E.Children.count(g)>1?E.Children.only(null):E.isValidElement(g)?g.props.children:null:A);return x.jsx(n,{...d,ref:a,children:E.isValidElement(g)?E.cloneElement(g,void 0,M):null})}return x.jsx(n,{...d,ref:a,children:c})});return u.displayName=`${o}.Slot`,u}var ze=F("Slot");function Je(o){const n=E.forwardRef((u,s)=>{const{children:a,...c}=u;if(E.isValidElement(a)){const d=Ge(a),v=Be(c,a.props);return a.type!==E.Fragment&&(v.ref=s?I(s,d):d),E.cloneElement(a,v)}return E.Children.count(a)>1?E.Children.only(null):null});return n.displayName=`${o}.SlotClone`,n}var he=Symbol("radix.slottable");function He(o){const n=({children:u})=>x.jsx(x.Fragment,{children:u});return n.displayName=`${o}.Slottable`,n.__radixId=he,n}function Le(o){return E.isValidElement(o)&&typeof o.type=="function"&&"__radixId"in o.type&&o.type.__radixId===he}function Be(o,n){const u={...n};for(const s in n){const a=o[s],c=n[s];/^on[A-Z]/.test(s)?a&&c?u[s]=(...v)=>{const b=c(...v);return a(...v),b}:a&&(u[s]=a):s==="style"?u[s]={...a,...c}:s==="className"&&(u[s]=[a,c].filter(Boolean).join(" "))}return{...o,...u}}function Ge(o){var s,a;let n=(s=Object.getOwnPropertyDescriptor(o.props,"ref"))==null?void 0:s.get,u=n&&"isReactWarning"in n&&n.isReactWarning;return u?o.ref:(n=(a=Object.getOwnPropertyDescriptor(o,"ref"))==null?void 0:a.get,u=n&&"isReactWarning"in n&&n.isReactWarning,u?o.props.ref:o.props.ref||o.ref)}var Ie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xe=Ie.reduce((o,n)=>{const u=F(`Primitive.${n}`),s=E.forwardRef((a,c)=>{const{asChild:d,...v}=a,b=d?u:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(b,{...v,ref:c})});return s.displayName=`Primitive.${n}`,{...o,[n]:s}},{});function Fe(o,n){o&&$e.flushSync(()=>o.dispatchEvent(n))}var Te=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},Xe="Portal",X=E.forwardRef((o,n)=>{var v;const{container:u,...s}=o,[a,c]=E.useState(!1);Te(()=>c(!0),[]);const d=u||a&&((v=globalThis==null?void 0:globalThis.document)==null?void 0:v.body);return d?Se.createPortal(x.jsx(xe.div,{...s,ref:n}),d):null});X.displayName=Xe;var Ze=X;exports.Portal=X;exports.Primitive=xe;exports.Root=Ze;exports.Slot=ze;exports.composeRefs=I;exports.createSlot=F;exports.createSlottable=He;exports.dispatchDiscreteCustomEvent=Fe;exports.jsxRuntimeExports=x;exports.useComposedRefs=qe;exports.useLayoutEffect2=Te;
|