@gears-frontx/ui-kit 0.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +49 -0
- package/README.md +75 -0
- package/dist/badge.d.ts +1 -0
- package/dist/badge.js +42 -0
- package/dist/badge.js.map +1 -0
- package/dist/button.d.ts +1 -0
- package/dist/button.js +73 -0
- package/dist/button.js.map +1 -0
- package/dist/card.d.ts +1 -0
- package/dist/card.js +54 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.d.ts +1 -0
- package/dist/checkbox.js +46 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chunks/badge.ej-3-Xs4.css +1 -0
- package/dist/chunks/button.CKfALaMe.css +1 -0
- package/dist/chunks/card.B0AcyAT1.css +1 -0
- package/dist/chunks/checkbox.Dd6YDr20.css +1 -0
- package/dist/chunks/dialog.D6LS2vnG.css +1 -0
- package/dist/chunks/dropdown-menu.DmDZc5gB.css +1 -0
- package/dist/chunks/field.BNZx8HfN.css +1 -0
- package/dist/chunks/input.CrRQ0OAn.css +1 -0
- package/dist/chunks/label.jrB9zD_G.css +1 -0
- package/dist/chunks/radio-group.1Y6B0lXt.css +1 -0
- package/dist/chunks/select.BmyP2S2q.css +1 -0
- package/dist/chunks/separator.DdRRkJW4.css +1 -0
- package/dist/chunks/skeleton.BhWSzPnI.css +1 -0
- package/dist/chunks/switch.B_ebMSxR.css +1 -0
- package/dist/chunks/table.r8ppNt1W.css +1 -0
- package/dist/chunks/tabs.DqJE9cX3.css +1 -0
- package/dist/chunks/textarea.BKWvs6fD.css +1 -0
- package/dist/chunks/toast.DMl31Mq4.css +1 -0
- package/dist/chunks/tooltip.apA3VWHJ.css +1 -0
- package/dist/components/badge/badge.d.ts +11 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/public.d.ts +2 -0
- package/dist/components/badge/public.d.ts.map +1 -0
- package/dist/components/button/button.d.ts +50 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/public.d.ts +2 -0
- package/dist/components/button/public.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +22 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/public.d.ts +2 -0
- package/dist/components/card/public.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +6 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/public.d.ts +2 -0
- package/dist/components/checkbox/public.d.ts.map +1 -0
- package/dist/components/dialog/dialog.d.ts +58 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -0
- package/dist/components/dialog/public.d.ts +2 -0
- package/dist/components/dialog/public.d.ts.map +1 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +70 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu/public.d.ts +2 -0
- package/dist/components/dropdown-menu/public.d.ts.map +1 -0
- package/dist/components/field/field.d.ts +18 -0
- package/dist/components/field/field.d.ts.map +1 -0
- package/dist/components/field/public.d.ts +2 -0
- package/dist/components/field/public.d.ts.map +1 -0
- package/dist/components/input/input.d.ts +6 -0
- package/dist/components/input/input.d.ts.map +1 -0
- package/dist/components/input/public.d.ts +2 -0
- package/dist/components/input/public.d.ts.map +1 -0
- package/dist/components/label/label.d.ts +4 -0
- package/dist/components/label/label.d.ts.map +1 -0
- package/dist/components/label/public.d.ts +2 -0
- package/dist/components/label/public.d.ts.map +1 -0
- package/dist/components/radio-group/public.d.ts +2 -0
- package/dist/components/radio-group/public.d.ts.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +11 -0
- package/dist/components/radio-group/radio-group.d.ts.map +1 -0
- package/dist/components/select/public.d.ts +2 -0
- package/dist/components/select/public.d.ts.map +1 -0
- package/dist/components/select/select.d.ts +61 -0
- package/dist/components/select/select.d.ts.map +1 -0
- package/dist/components/separator/public.d.ts +2 -0
- package/dist/components/separator/public.d.ts.map +1 -0
- package/dist/components/separator/separator.d.ts +6 -0
- package/dist/components/separator/separator.d.ts.map +1 -0
- package/dist/components/skeleton/public.d.ts +2 -0
- package/dist/components/skeleton/public.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.d.ts +4 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/switch/public.d.ts +2 -0
- package/dist/components/switch/public.d.ts.map +1 -0
- package/dist/components/switch/switch.d.ts +11 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/table/public.d.ts +2 -0
- package/dist/components/table/public.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +38 -0
- package/dist/components/table/table.d.ts.map +1 -0
- package/dist/components/tabs/public.d.ts +2 -0
- package/dist/components/tabs/public.d.ts.map +1 -0
- package/dist/components/tabs/tabs.d.ts +23 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/textarea/public.d.ts +2 -0
- package/dist/components/textarea/public.d.ts.map +1 -0
- package/dist/components/textarea/textarea.d.ts +4 -0
- package/dist/components/textarea/textarea.d.ts.map +1 -0
- package/dist/components/toast/public.d.ts +2 -0
- package/dist/components/toast/public.d.ts.map +1 -0
- package/dist/components/toast/toast.d.ts +85 -0
- package/dist/components/toast/toast.d.ts.map +1 -0
- package/dist/components/tooltip/public.d.ts +2 -0
- package/dist/components/tooltip/public.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +41 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/dialog.d.ts +1 -0
- package/dist/dialog.js +84 -0
- package/dist/dialog.js.map +1 -0
- package/dist/docs/badge.md +82 -0
- package/dist/docs/button.md +102 -0
- package/dist/docs/card.md +131 -0
- package/dist/docs/checkbox.md +55 -0
- package/dist/docs/dialog.md +124 -0
- package/dist/docs/dropdown-menu.md +140 -0
- package/dist/docs/field.md +68 -0
- package/dist/docs/input.md +65 -0
- package/dist/docs/label.md +50 -0
- package/dist/docs/radio-group.md +59 -0
- package/dist/docs/select.md +99 -0
- package/dist/docs/separator.md +119 -0
- package/dist/docs/skeleton.md +143 -0
- package/dist/docs/switch.md +51 -0
- package/dist/docs/table.md +276 -0
- package/dist/docs/tabs.md +124 -0
- package/dist/docs/textarea.md +52 -0
- package/dist/docs/toast.md +153 -0
- package/dist/docs/tooltip.md +134 -0
- package/dist/dropdown-menu.d.ts +1 -0
- package/dist/dropdown-menu.js +183 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/field.d.ts +1 -0
- package/dist/field.js +28 -0
- package/dist/field.js.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/input.d.ts +1 -0
- package/dist/input.js +30 -0
- package/dist/input.js.map +1 -0
- package/dist/label.d.ts +1 -0
- package/dist/label.js +12 -0
- package/dist/label.js.map +1 -0
- package/dist/radio-group.d.ts +1 -0
- package/dist/radio-group.js +21 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/select.d.ts +1 -0
- package/dist/select.js +175 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +1 -0
- package/dist/separator.js +13 -0
- package/dist/separator.js.map +1 -0
- package/dist/skeleton.d.ts +1 -0
- package/dist/skeleton.js +12 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/switch.d.ts +1 -0
- package/dist/switch.js +26 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.d.ts +1 -0
- package/dist/table.js +64 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.d.ts +1 -0
- package/dist/tabs.js +41 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.d.ts +1 -0
- package/dist/textarea.js +13 -0
- package/dist/textarea.js.map +1 -0
- package/dist/theme.css +485 -0
- package/dist/toast.d.ts +1 -0
- package/dist/toast.js +193 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.d.ts +1 -0
- package/dist/tooltip.js +49 -0
- package/dist/tooltip.js.map +1 -0
- package/llms.txt +148 -0
- package/package.json +85 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/components/separator/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
|
|
2
|
+
export interface SeparatorProps extends Omit<SeparatorPrimitive.Props, 'className'> {
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function Separator({ className, ...props }: SeparatorProps): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../src/components/separator/separator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAgD3E,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAEhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/skeleton/skeleton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAqB5C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAElD,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,+BAE9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/components/switch/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Switch as SwitchPrimitive } from '@base-ui/react/switch';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const switchVariants: (props?: ({
|
|
4
|
+
size?: "default" | "sm" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface SwitchProps extends Omit<SwitchPrimitive.Root.Props, 'className'>, VariantProps<typeof switchVariants> {
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Switch({ className, size, ...props }: SwitchProps): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;8EAUlB,CAAC;AAEH,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,+BAMhE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Table, type TableProps, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, TableRow, type TableRowProps, } from './table.js';
|
|
2
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/components/table/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,KAAK,UAAU,EACf,SAAS,EACT,KAAK,cAAc,EACnB,YAAY,EACZ,KAAK,iBAAiB,EACtB,SAAS,EACT,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,gBAAgB,EACrB,SAAS,EACT,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,gBAAgB,EACrB,QAAQ,EACR,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export interface TableProps extends ComponentProps<'table'> {
|
|
3
|
+
/**
|
|
4
|
+
* Accessible name for the focusable scroll wrapper around the table
|
|
5
|
+
* (`role="region"` + `aria-label`). Announced when keyboard focus lands
|
|
6
|
+
* on the wrapper; without it the stop announces nothing.
|
|
7
|
+
*/
|
|
8
|
+
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Cell metrics only — `compact` tightens row padding for operational
|
|
11
|
+
* views (the mockups' Data Table density axis). Not a data-table
|
|
12
|
+
* feature: no virtualization, no row model, purely the cells' padding.
|
|
13
|
+
*/
|
|
14
|
+
density?: 'default' | 'compact';
|
|
15
|
+
}
|
|
16
|
+
export declare function Table({ className, label, density, ...props }: TableProps): import("react").JSX.Element;
|
|
17
|
+
export type TableHeaderProps = ComponentProps<'thead'>;
|
|
18
|
+
export declare function TableHeader({ className, ...props }: TableHeaderProps): import("react").JSX.Element;
|
|
19
|
+
export type TableBodyProps = ComponentProps<'tbody'>;
|
|
20
|
+
export declare function TableBody({ className, ...props }: TableBodyProps): import("react").JSX.Element;
|
|
21
|
+
export type TableFooterProps = ComponentProps<'tfoot'>;
|
|
22
|
+
export declare function TableFooter({ className, ...props }: TableFooterProps): import("react").JSX.Element;
|
|
23
|
+
export type TableRowProps = ComponentProps<'tr'>;
|
|
24
|
+
export declare function TableRow({ className, ...props }: TableRowProps): import("react").JSX.Element;
|
|
25
|
+
export type TableHeadProps = ComponentProps<'th'>;
|
|
26
|
+
export declare function TableHead({ className, ...props }: TableHeadProps): import("react").JSX.Element;
|
|
27
|
+
export type TableCellProps = ComponentProps<'td'>;
|
|
28
|
+
export declare function TableCell({ className, ...props }: TableCellProps): import("react").JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* A table's accessible name/description, kept as a real semantic caption
|
|
31
|
+
* regardless of where it's drawn — `.table`'s `caption-side: bottom` (see
|
|
32
|
+
* table.module.css) only moves it visually below the rows; a `<caption>`
|
|
33
|
+
* contributes to the table's accessibility tree the same way at either
|
|
34
|
+
* position.
|
|
35
|
+
*/
|
|
36
|
+
export type TableCaptionProps = ComponentProps<'caption'>;
|
|
37
|
+
export declare function TableCaption({ className, ...props }: TableCaptionProps): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAyC5C,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,OAAO,CAAC;IACzD;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAED,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAcxE;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAEvD,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,+BAEpE;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAErD,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAEhE;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAEvD,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,+BAEpE;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;AAEjD,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,+BAE9D;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;AAElD,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAEhE;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;AAElD,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAEhE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;AAE1D,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAEtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,KAAK,SAAS,EACd,WAAW,EACX,KAAK,gBAAgB,EACrB,QAAQ,EACR,KAAK,aAAa,EAClB,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
export interface TabsProps extends Omit<TabsPrimitive.Root.Props, 'className'> {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Tabs({ className, ...props }: TabsProps): import("react").JSX.Element;
|
|
7
|
+
declare const tabsListVariants: (props?: ({
|
|
8
|
+
variant?: "line" | "default" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
export interface TabsListProps extends Omit<TabsPrimitive.List.Props, 'className'>, VariantProps<typeof tabsListVariants> {
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function TabsList({ className, variant, ...props }: TabsListProps): import("react").JSX.Element;
|
|
14
|
+
export interface TabsTriggerProps extends Omit<TabsPrimitive.Tab.Props, 'className'> {
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function TabsTrigger({ className, ...props }: TabsTriggerProps): import("react").JSX.Element;
|
|
18
|
+
export interface TabsContentProps extends Omit<TabsPrimitive.Panel.Props, 'className'> {
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function TabsContent({ className, ...props }: TabsContentProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAuBtE,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAEtD;AAED,QAAA,MAAM,gBAAgB;;8EAUpB,CAAC;AAEH,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,EACjD,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,+BAEvE;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,+BAEpE;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,+BAEpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;AAKvD,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,+BAI9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/components/toast/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,EACL,OAAO,EACP,KAAK,YAAY,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Toast as ToastPrimitive } from '@base-ui/react/toast';
|
|
2
|
+
/**
|
|
3
|
+
* Shared imperative toast manager: call `toast.add({ title, description })`
|
|
4
|
+
* (or `.close()`, `.update()`, `.promise()`) from anywhere in the app —
|
|
5
|
+
* no hook, and no ancestor `Toaster`/`ToastProvider`, required to fire
|
|
6
|
+
* one. `Toaster` renders whatever this manager holds by default.
|
|
7
|
+
*
|
|
8
|
+
* A module-scope singleton is a deliberate choice, not the only shape Base
|
|
9
|
+
* UI's Toast offers (see `createToastManager`/`useToastManager` below): it
|
|
10
|
+
* keeps sonner's own call-anywhere `toast()` ergonomics (see
|
|
11
|
+
* design-notes.md for why Base UI's Toast replaced sonner) without needing
|
|
12
|
+
* a component to be inside a Provider's subtree or accept a manager prop.
|
|
13
|
+
*
|
|
14
|
+
* Three failure modes worth knowing about a singleton, all silent: it's
|
|
15
|
+
* SSR-safe (the object above holds no toast state itself, only a listener
|
|
16
|
+
* registered by whichever `Toaster` mounts), but `toast.add(...)` called
|
|
17
|
+
* before any `Toaster` has mounted, or from code that resolved a
|
|
18
|
+
* different copy of this module (e.g. a mixed CJS/ESM require graph),
|
|
19
|
+
* drops the toast with no error — there is no queue and nothing to catch.
|
|
20
|
+
* And the inverse: TWO mounted `Toaster`s on this shared manager render
|
|
21
|
+
* every toast twice, once per viewport (plausible in a shell + MFE setup
|
|
22
|
+
* where each fragment mounts its own) — a second viewport should get its
|
|
23
|
+
* own `createToastManager()` instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare const toast: import('@base-ui/react/toast').ToastManager<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Reads the live toast list and the `add`/`close`/`update`/`promise`
|
|
28
|
+
* bound to whichever manager the nearest `Toaster` ancestor was given
|
|
29
|
+
* (the shared `toast` singleton unless overridden) — from a component
|
|
30
|
+
* nested under `Toaster`, this is how you react to the toast list itself
|
|
31
|
+
* (e.g. an unread-count badge) or call that same manager without
|
|
32
|
+
* importing it directly. Not a way to render toast cards in place of
|
|
33
|
+
* `Toaster`: the kit exports no Root/Content/Title/etc. parts to build
|
|
34
|
+
* one with.
|
|
35
|
+
*
|
|
36
|
+
* Whether a consumer's own `@base-ui/react` shares this context depends
|
|
37
|
+
* on whether the installer resolved one copy or two. `@base-ui/react` is
|
|
38
|
+
* a regular dependency of this package and stays external in the build
|
|
39
|
+
* (nothing is bundled but the CSS class maps), so a consumer whose own
|
|
40
|
+
* range is satisfied by the same version dedupes to a single copy and
|
|
41
|
+
* shares context; a consumer pinned to an incompatible version gets a
|
|
42
|
+
* nested second copy, and then Base UI's Toast context — like every
|
|
43
|
+
* React context — does not cross between them.
|
|
44
|
+
*/
|
|
45
|
+
export declare const useToastManager: typeof ToastPrimitive.useToastManager;
|
|
46
|
+
/**
|
|
47
|
+
* Creates an isolated toast manager, independent of the shared `toast`
|
|
48
|
+
* singleton — e.g. to scope a second, differently-positioned `Toaster` to
|
|
49
|
+
* one part of the app instead of sharing the app-wide instance. Pass the
|
|
50
|
+
* result as `toastManager` to `Toaster`.
|
|
51
|
+
*/
|
|
52
|
+
export declare const createToastManager: typeof ToastPrimitive.createToastManager;
|
|
53
|
+
export interface ToasterProps extends ToastPrimitive.Provider.Props {
|
|
54
|
+
/**
|
|
55
|
+
* Where to portal the toast viewport. Defaults to <body>. Pass a themed
|
|
56
|
+
* container when the theme is scoped to a subtree (data-theme on a
|
|
57
|
+
* container that isn't at document root) so toasts inherit its tokens
|
|
58
|
+
* and font.
|
|
59
|
+
*/
|
|
60
|
+
container?: ToastPrimitive.Portal.Props['container'];
|
|
61
|
+
/**
|
|
62
|
+
* Accessible name for each toast's close (X) button — one of the two
|
|
63
|
+
* strings a non-English app needs to replace (`label` below is the
|
|
64
|
+
* other). @default 'Close toast'
|
|
65
|
+
*/
|
|
66
|
+
closeLabel?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Accessible name for the toast region landmark. Base UI puts
|
|
69
|
+
* `role="region" aria-label="Notifications"` on the viewport; without
|
|
70
|
+
* this prop a screen-reader user hears that English landmark name no
|
|
71
|
+
* matter what language the app is in. @default 'Notifications'
|
|
72
|
+
*/
|
|
73
|
+
label?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Mount once, wrapping the app (or at least any subtree that calls
|
|
77
|
+
* `useToastManager`) — pass the app as `children`. The toast list itself
|
|
78
|
+
* portals to `<body>` (or `container`) regardless of where `Toaster` sits
|
|
79
|
+
* in the tree, so wrapping vs. mounting as a leaf near the root both work
|
|
80
|
+
* for the common case of firing toasts via the `toast` manager above.
|
|
81
|
+
*
|
|
82
|
+
* Defaults `toastManager` to this module's shared singleton — see `toast`.
|
|
83
|
+
*/
|
|
84
|
+
export declare function Toaster({ container, children, closeLabel, label, toastManager, ...props }: ToasterProps): import("react").JSX.Element;
|
|
85
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAkL/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,KAAK,kDAAsC,CAAC;AAEzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,uCAAiC,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,0CAAoC,CAAC;AAEpE,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,QAAQ,CAAC,KAAK;IACjE;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACrD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,UAA0B,EAG1B,KAAuB,EACvB,YAAoB,EACpB,GAAG,KAAK,EACT,EAAE,YAAY,+BAWd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,cAAc,EACd,KAAK,mBAAmB,EACxB,eAAe,EACf,KAAK,oBAAoB,EACzB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
|
|
2
|
+
export declare const Tooltip: <Payload>(props: TooltipPrimitive.Root.Props<Payload>) => import("react").JSX.Element;
|
|
3
|
+
/**
|
|
4
|
+
* The root is a Base UI pass-through, but its props type is still exported:
|
|
5
|
+
* a consumer writing a typed wrapper imports it from this kit — Base UI is
|
|
6
|
+
* this package's dependency, not necessarily theirs. Same idiom as
|
|
7
|
+
* TooltipProviderProps below.
|
|
8
|
+
*/
|
|
9
|
+
export type TooltipProps = TooltipPrimitive.Root.Props;
|
|
10
|
+
/**
|
|
11
|
+
* Optional. Mount once near the app root to share open/close delay and
|
|
12
|
+
* grouping across many tooltips (hover one, and adjacent ones within
|
|
13
|
+
* `timeout` reopen instantly — see Base UI Tooltip.Provider). Without it,
|
|
14
|
+
* each `Tooltip` behaves standalone with Base UI's own per-trigger default
|
|
15
|
+
* (600ms open delay, no grouping).
|
|
16
|
+
*
|
|
17
|
+
* Deliberately does not default `delay` to `0` the way base-vega's own
|
|
18
|
+
* wrapper does: that default is coherent in a model where the Provider is
|
|
19
|
+
* mounted once, globally, at the app root, but this kit ships it as
|
|
20
|
+
* optional — silently defaulting to instant-open would mean identical
|
|
21
|
+
* trigger markup opens at 600ms or 0ms depending on an invisible ancestor.
|
|
22
|
+
* Pass `delay` explicitly (here, or per `TooltipTrigger`) to opt into
|
|
23
|
+
* faster grouped tooltips.
|
|
24
|
+
*/
|
|
25
|
+
export declare const TooltipProvider: import('react').FC<import('@base-ui/react/tooltip').TooltipProviderProps>;
|
|
26
|
+
export type TooltipProviderProps = TooltipPrimitive.Provider.Props;
|
|
27
|
+
export interface TooltipTriggerProps extends Omit<TooltipPrimitive.Trigger.Props, 'className'> {
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function TooltipTrigger({ className, ...props }: TooltipTriggerProps): import("react").JSX.Element;
|
|
31
|
+
export interface TooltipContentProps extends Omit<TooltipPrimitive.Popup.Props, 'className'>, Pick<TooltipPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'positionMethod' | 'collisionBoundary' | 'collisionPadding'> {
|
|
32
|
+
className?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Where to portal the popup. Defaults to <body>. Pass a themed container
|
|
35
|
+
* when the theme is scoped to a subtree (data-theme on a container that
|
|
36
|
+
* isn't at document root) so the popup inherits its tokens and font.
|
|
37
|
+
*/
|
|
38
|
+
container?: TooltipPrimitive.Portal.Props['container'];
|
|
39
|
+
}
|
|
40
|
+
export declare function TooltipContent({ className, children, container, side, sideOffset, align, alignOffset, positionMethod, collisionBoundary, collisionPadding, ...props }: TooltipContentProps): import("react").JSX.Element;
|
|
41
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAKrE,eAAO,MAAM,OAAO,uFAAwB,CAAC;AAC7C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,2EAA4B,CAAC;AACzD,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC;AAEnE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAE1E;AAED,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,EACrD,IAAI,CACF,gBAAgB,CAAC,UAAU,CAAC,KAAK,EAG/B,OAAO,GACP,aAAa,GACb,MAAM,GACN,YAAY,GACZ,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,CACrB;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;CACxD;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,SAAS,EACT,IAAY,EACZ,UAAc,EACd,KAAgB,EAChB,WAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,mBAAmB,+BAoBrB"}
|
package/dist/dialog.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/dialog/public.js'
|
package/dist/dialog.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as r } from "@base-ui/react/dialog";
|
|
3
|
+
import { cx as i } from "class-variance-authority";
|
|
4
|
+
import { Button as d } from "./button.js";
|
|
5
|
+
import './chunks/dialog.D6LS2vnG.css';const m = "_backdrop_u306m_6", _ = "_popup_u306m_22", g = "_closeButton_u306m_120", f = "_header_u306m_126", D = "_footer_u306m_132", h = "_title_u306m_146", k = "_description_u306m_154", v = "_svgIcon_u306m_161", n = {
|
|
6
|
+
backdrop: m,
|
|
7
|
+
popup: _,
|
|
8
|
+
closeButton: g,
|
|
9
|
+
header: f,
|
|
10
|
+
footer: D,
|
|
11
|
+
title: h,
|
|
12
|
+
description: k,
|
|
13
|
+
svgIcon: v
|
|
14
|
+
};
|
|
15
|
+
function N({ className: o }) {
|
|
16
|
+
return /* @__PURE__ */ e(
|
|
17
|
+
"svg",
|
|
18
|
+
{
|
|
19
|
+
className: i(n.svgIcon, o),
|
|
20
|
+
viewBox: "0 0 24 24",
|
|
21
|
+
fill: "none",
|
|
22
|
+
stroke: "currentColor",
|
|
23
|
+
strokeWidth: "2",
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeLinejoin: "round",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
children: /* @__PURE__ */ e("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
const I = r.Root;
|
|
32
|
+
function T({ className: o, ...t }) {
|
|
33
|
+
return /* @__PURE__ */ e(r.Trigger, { className: o, ...t });
|
|
34
|
+
}
|
|
35
|
+
function j({ className: o, ...t }) {
|
|
36
|
+
return /* @__PURE__ */ e(r.Close, { className: o, ...t });
|
|
37
|
+
}
|
|
38
|
+
function L({
|
|
39
|
+
className: o,
|
|
40
|
+
children: t,
|
|
41
|
+
container: c,
|
|
42
|
+
showCloseButton: a = !0,
|
|
43
|
+
showBackdrop: l = !0,
|
|
44
|
+
closeLabel: u = "Close",
|
|
45
|
+
...p
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ s(r.Portal, { container: c, children: [
|
|
48
|
+
l && /* @__PURE__ */ e(r.Backdrop, { className: n.backdrop }),
|
|
49
|
+
/* @__PURE__ */ s(r.Popup, { className: i(n.popup, o), ...p, children: [
|
|
50
|
+
t,
|
|
51
|
+
a && /* @__PURE__ */ e(
|
|
52
|
+
r.Close,
|
|
53
|
+
{
|
|
54
|
+
"aria-label": u,
|
|
55
|
+
className: n.closeButton,
|
|
56
|
+
render: /* @__PURE__ */ e(d, { variant: "ghost", icon: /* @__PURE__ */ e(N, {}) })
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] })
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
function M({ className: o, ...t }) {
|
|
63
|
+
return /* @__PURE__ */ e("div", { className: i(n.header, o), ...t });
|
|
64
|
+
}
|
|
65
|
+
function P({ className: o, ...t }) {
|
|
66
|
+
return /* @__PURE__ */ e("div", { className: i(n.footer, o), ...t });
|
|
67
|
+
}
|
|
68
|
+
function w({ className: o, ...t }) {
|
|
69
|
+
return /* @__PURE__ */ e(r.Title, { className: i(n.title, o), ...t });
|
|
70
|
+
}
|
|
71
|
+
function y({ className: o, ...t }) {
|
|
72
|
+
return /* @__PURE__ */ e(r.Description, { className: i(n.description, o), ...t });
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
I as Dialog,
|
|
76
|
+
j as DialogClose,
|
|
77
|
+
L as DialogContent,
|
|
78
|
+
y as DialogDescription,
|
|
79
|
+
P as DialogFooter,
|
|
80
|
+
M as DialogHeader,
|
|
81
|
+
w as DialogTitle,
|
|
82
|
+
T as DialogTrigger
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../src/components/dialog/dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { cx } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\n\nimport { Button } from '../button/button';\nimport styles from './dialog.module.css';\n\n/* Inline lucide path (ISC) — the kit carries no icon dependency. */\nfunction CloseIcon({ className }: { className?: string }) {\n return (\n <svg\n className={cx(styles.svgIcon, className)}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n );\n}\n\nexport const Dialog = DialogPrimitive.Root;\n/**\n * The root is a Base UI pass-through, but its props type is still exported:\n * a consumer writing a typed wrapper imports it from this kit — Base UI is\n * this package's dependency, not necessarily theirs. Same idiom as\n * TooltipProviderProps.\n */\nexport type DialogProps = DialogPrimitive.Root.Props;\n\nexport interface DialogTriggerProps extends Omit<DialogPrimitive.Trigger.Props, 'className'> {\n className?: string;\n}\n\nexport function DialogTrigger({ className, ...props }: DialogTriggerProps) {\n return <DialogPrimitive.Trigger className={className} {...props} />;\n}\n\nexport interface DialogCloseProps extends Omit<DialogPrimitive.Close.Props, 'className'> {\n className?: string;\n}\n\nexport function DialogClose({ className, ...props }: DialogCloseProps) {\n return <DialogPrimitive.Close className={className} {...props} />;\n}\n\nexport interface DialogContentProps extends Omit<DialogPrimitive.Popup.Props, 'className'> {\n className?: string;\n /**\n * Where to portal the popup. Defaults to <body>. Pass a themed container\n * when the theme is scoped to a subtree (data-theme on a container that\n * isn't at document root) so the popup inherits its tokens and font.\n */\n container?: DialogPrimitive.Portal.Props['container'];\n /** Renders a top-right close (X) button inside the popup. @default true */\n showCloseButton?: boolean;\n /**\n * Accessible name for the built-in close (X) button — the popup's only\n * kit-authored text, so the one string a non-English app needs to\n * replace. Same contract as Toaster's closeLabel. @default 'Close'\n */\n closeLabel?: string;\n /**\n * Renders the dimming backdrop behind the popup. Pair with\n * `modal={false}` on the root for a genuinely non-modal dialog: without\n * this opt-out the backdrop still covers (and click-closes over) the\n * page even when the root no longer traps focus or locks scroll, so\n * `modal={false}` alone never yields a usable non-modal surface.\n * @default true\n */\n showBackdrop?: boolean;\n}\n\nexport function DialogContent({\n className,\n children,\n container,\n showCloseButton = true,\n showBackdrop = true,\n closeLabel = 'Close',\n ...props\n}: DialogContentProps) {\n return (\n <DialogPrimitive.Portal container={container}>\n {showBackdrop && <DialogPrimitive.Backdrop className={styles.backdrop} />}\n <DialogPrimitive.Popup className={cx(styles.popup, className)} {...props}>\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n aria-label={closeLabel}\n className={styles.closeButton}\n render={<Button variant=\"ghost\" icon={<CloseIcon />} />}\n />\n )}\n </DialogPrimitive.Popup>\n </DialogPrimitive.Portal>\n );\n}\n\nexport type DialogHeaderProps = ComponentProps<'div'>;\n\nexport function DialogHeader({ className, ...props }: DialogHeaderProps) {\n return <div className={cx(styles.header, className)} {...props} />;\n}\n\nexport type DialogFooterProps = ComponentProps<'div'>;\n\nexport function DialogFooter({ className, ...props }: DialogFooterProps) {\n return <div className={cx(styles.footer, className)} {...props} />;\n}\n\nexport interface DialogTitleProps extends Omit<DialogPrimitive.Title.Props, 'className'> {\n className?: string;\n}\n\nexport function DialogTitle({ className, ...props }: DialogTitleProps) {\n return <DialogPrimitive.Title className={cx(styles.title, className)} {...props} />;\n}\n\nexport interface DialogDescriptionProps\n extends Omit<DialogPrimitive.Description.Props, 'className'> {\n className?: string;\n}\n\nexport function DialogDescription({ className, ...props }: DialogDescriptionProps) {\n return <DialogPrimitive.Description className={cx(styles.description, className)} {...props} />;\n}\n"],"names":["CloseIcon","className","jsx","cx","styles","Dialog","DialogPrimitive","DialogTrigger","props","DialogClose","DialogContent","children","container","showCloseButton","showBackdrop","closeLabel","jsxs","Button","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;;;;;;;;;;;AAQA,SAASA,EAAU,EAAE,WAAAC,KAAqC;AACxD,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAGC,EAAO,SAASH,CAAS;AAAA,MACvC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAY;AAAA,MAEZ,UAAA,gBAAAC,EAAC,QAAA,EAAK,GAAE,uBAAA,CAAuB;AAAA,IAAA;AAAA,EAAA;AAGrC;AAEO,MAAMG,IAASC,EAAgB;AAa/B,SAASC,EAAc,EAAE,WAAAN,GAAW,GAAGO,KAA6B;AACzE,2BAAQF,EAAgB,SAAhB,EAAwB,WAAAL,GAAuB,GAAGO,GAAO;AACnE;AAMO,SAASC,EAAY,EAAE,WAAAR,GAAW,GAAGO,KAA2B;AACrE,2BAAQF,EAAgB,OAAhB,EAAsB,WAAAL,GAAuB,GAAGO,GAAO;AACjE;AA6BO,SAASE,EAAc;AAAA,EAC5B,WAAAT;AAAA,EACA,UAAAU;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,cAAAC,IAAe;AAAA,EACf,YAAAC,IAAa;AAAA,EACb,GAAGP;AACL,GAAuB;AACrB,SACE,gBAAAQ,EAACV,EAAgB,QAAhB,EAAuB,WAAAM,GACrB,UAAA;AAAA,IAAAE,uBAAiBR,EAAgB,UAAhB,EAAyB,WAAWF,EAAO,UAAU;AAAA,IACvE,gBAAAY,EAACV,EAAgB,OAAhB,EAAsB,WAAWH,EAAGC,EAAO,OAAOH,CAAS,GAAI,GAAGO,GAChE,UAAA;AAAA,MAAAG;AAAA,MACAE,KACC,gBAAAX;AAAA,QAACI,EAAgB;AAAA,QAAhB;AAAA,UACC,cAAYS;AAAA,UACZ,WAAWX,EAAO;AAAA,UAClB,0BAASa,GAAA,EAAO,SAAQ,SAAQ,MAAM,gBAAAf,EAACF,KAAU,EAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,IACvD,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;AAIO,SAASkB,EAAa,EAAE,WAAAjB,GAAW,GAAGO,KAA4B;AACvE,SAAO,gBAAAN,EAAC,SAAI,WAAWC,EAAGC,EAAO,QAAQH,CAAS,GAAI,GAAGO,GAAO;AAClE;AAIO,SAASW,EAAa,EAAE,WAAAlB,GAAW,GAAGO,KAA4B;AACvE,SAAO,gBAAAN,EAAC,SAAI,WAAWC,EAAGC,EAAO,QAAQH,CAAS,GAAI,GAAGO,GAAO;AAClE;AAMO,SAASY,EAAY,EAAE,WAAAnB,GAAW,GAAGO,KAA2B;AACrE,SAAO,gBAAAN,EAACI,EAAgB,OAAhB,EAAsB,WAAWH,EAAGC,EAAO,OAAOH,CAAS,GAAI,GAAGO,EAAA,CAAO;AACnF;AAOO,SAASa,EAAkB,EAAE,WAAApB,GAAW,GAAGO,KAAiC;AACjF,SAAO,gBAAAN,EAACI,EAAgB,aAAhB,EAA4B,WAAWH,EAAGC,EAAO,aAAaH,CAAS,GAAI,GAAGO,EAAA,CAAO;AAC/F;"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
|
|
3
|
+
A status label: a colored dot plus an intent-colored caption, as a soft
|
|
4
|
+
pill or a bare dot+label pair. Badge has no Base UI primitive — it's a
|
|
5
|
+
styled `span`, plus a `render` prop (via Base UI's `useRender`/`mergeProps`
|
|
6
|
+
utilities) for the one case that needs it: rendering as a link.
|
|
7
|
+
|
|
8
|
+
Badge speaks **semantic intent only** (per the Studio design): you say what
|
|
9
|
+
kind of state you're marking (`success`, `warning`, `info`, `danger`,
|
|
10
|
+
`muted`), never how to paint it. The prop is the kit-wide `variant` — like
|
|
11
|
+
every other component — but its values are states, not paint jobs: there is
|
|
12
|
+
no `primary`/`outline`/`ghost` here, and picking `warning` because you want
|
|
13
|
+
orange is a misuse, not a style choice.
|
|
14
|
+
|
|
15
|
+
## When to use
|
|
16
|
+
|
|
17
|
+
- A status attached to an entity in a list, table cell, or page header:
|
|
18
|
+
`running` → `success`, `failed` → `danger`, `pending` → `warning`,
|
|
19
|
+
`beta`/`new` → `info`, anything neutral (`draft`, `archived`, a count,
|
|
20
|
+
a category) → `muted`.
|
|
21
|
+
- `shape="pill"` (default) on busy surfaces where the label needs its own
|
|
22
|
+
soft fill; `shape="dot"` inline with text or in dense tables where a fill
|
|
23
|
+
would be noise — same dot and label, no pill behind them.
|
|
24
|
+
- A clickable status filter — pass `render={<a href="..." />}`. The pill's
|
|
25
|
+
fill deepens on hover and the dot shape underlines, but only when actually
|
|
26
|
+
rendered as a link; a plain badge stays visually inert and never looks
|
|
27
|
+
clickable when it isn't. The kit's focus ring appears automatically once
|
|
28
|
+
the anchor receives keyboard focus. Give it discernible text — a badge
|
|
29
|
+
with no accessible name is unusable via keyboard or screen reader.
|
|
30
|
+
|
|
31
|
+
## When not to use
|
|
32
|
+
|
|
33
|
+
- A clickable action with its own visual weight — use `button`.
|
|
34
|
+
- Long or wrapping text — Badge is single-line (`white-space: nowrap`) and
|
|
35
|
+
clips overflow.
|
|
36
|
+
- Prose-colored emphasis or arbitrary brand colors — intents are the whole
|
|
37
|
+
vocabulary; recoloring a badge via CSS breaks the semantic contract.
|
|
38
|
+
|
|
39
|
+
## Props (kit level)
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Default |
|
|
42
|
+
|------|------|---------|
|
|
43
|
+
| `variant` | `success` \| `warning` \| `info` \| `danger` \| `muted` | `muted` |
|
|
44
|
+
| `shape` | `pill` \| `dot` | `pill` |
|
|
45
|
+
| `render` | `ReactElement` — replaces the root `span`, e.g. with an `<a>` | — |
|
|
46
|
+
| `className` | `string` — merged after the variant/shape classes | — |
|
|
47
|
+
|
|
48
|
+
All other props are native `<span>` props (or the target element's props
|
|
49
|
+
when using `render`) and are forwarded as-is, including `aria-invalid`
|
|
50
|
+
(shows a destructive-tinted border and ring, independent of `variant`).
|
|
51
|
+
|
|
52
|
+
## Examples
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { Badge } from '@gears-frontx/ui-kit';
|
|
56
|
+
|
|
57
|
+
// Status labels (pill is the default shape)
|
|
58
|
+
<Badge variant="success">Running</Badge>
|
|
59
|
+
<Badge variant="danger">Failed</Badge>
|
|
60
|
+
<Badge variant="warning">Degraded</Badge>
|
|
61
|
+
<Badge variant="info">Beta</Badge>
|
|
62
|
+
<Badge>Draft</Badge> // muted is the default variant
|
|
63
|
+
|
|
64
|
+
// Bare dot+label for dense/inline placements
|
|
65
|
+
<Badge variant="success" shape="dot">Online</Badge>
|
|
66
|
+
|
|
67
|
+
// A badge that is actually a link — hover feedback only applies here
|
|
68
|
+
<Badge variant="info" render={<a href="/filters/open" />}>
|
|
69
|
+
3 open
|
|
70
|
+
</Badge>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Anti-patterns
|
|
74
|
+
|
|
75
|
+
- Do not pick a variant for its color ("warning looks nice and orange") —
|
|
76
|
+
intents are semantics; if no state maps, use `muted`.
|
|
77
|
+
- Do not recolor a badge via `className`/`style` — the intent palette and
|
|
78
|
+
its contrast math live in the kit; brand changes belong in theme tokens.
|
|
79
|
+
- Do not expect hover feedback from a plain (non-`render`) badge — it only
|
|
80
|
+
appears when the badge actually renders as a link via `render`.
|
|
81
|
+
- Do not nest interactive controls inside a Badge — it is a label, not a
|
|
82
|
+
container.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
An action button. Wraps the Base UI Button primitive: render-prop
|
|
4
|
+
polymorphism, correct disabled/focus behavior, `type="button"` by default
|
|
5
|
+
(pass `type="submit"` explicitly for form submission).
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
- Any click-triggered action: submit, delete, open a dialog, toggle a panel.
|
|
10
|
+
- An action that also navigates (e.g. "Open reports"):
|
|
11
|
+
`<Button render={<a href="..." />} nativeButton={false}>`. It is announced
|
|
12
|
+
as a button (`role="button"`), while the real anchor underneath keeps
|
|
13
|
+
cmd-click/middle-click and crawlability. Not a substitute for a link: for
|
|
14
|
+
plain navigation use the consumer app's link component.
|
|
15
|
+
|
|
16
|
+
## When not to use
|
|
17
|
+
|
|
18
|
+
- Plain in-text navigation — use the consumer app's link component, not
|
|
19
|
+
`variant="link"`; that variant exists for actions that visually read as
|
|
20
|
+
links.
|
|
21
|
+
- Toggling on/off state — use `switch` or `checkbox` instead.
|
|
22
|
+
|
|
23
|
+
## Props (kit level)
|
|
24
|
+
|
|
25
|
+
| Prop | Type | Default |
|
|
26
|
+
|------|------|---------|
|
|
27
|
+
| `variant` | `default` \| `destructive` \| `outline` \| `secondary` \| `ghost` \| `link` | `default` |
|
|
28
|
+
| `size` | `default` \| `sm` \| `lg` (the F-mockups' md/sm/lg scale; `default` is md) | `default` |
|
|
29
|
+
| `icon` | `ReactNode` — leading icon slot, marked decorative (`aria-hidden`); the ONLY right place for a button icon | — |
|
|
30
|
+
| `loading` | `boolean` — centered spinner, disables the button, sets `aria-busy`; content keeps its space and the button keeps its accessible name | `false` |
|
|
31
|
+
| `render` | `ReactElement` — replaces the root element, button semantics are applied to it | — |
|
|
32
|
+
| `nativeButton` | `boolean` — set to `false` whenever `render` is not a native `<button>` | `true` |
|
|
33
|
+
| `focusableWhenDisabled` | `boolean` — keep the button in tab order when disabled | `false` |
|
|
34
|
+
| `className` | `string` — merged after variant classes | — |
|
|
35
|
+
|
|
36
|
+
All other props are native `<button>` props (`onClick`, `disabled`, `type`,
|
|
37
|
+
`aria-*`, ...) and are forwarded as-is.
|
|
38
|
+
|
|
39
|
+
Icon-only is derived, not a size: `icon` with no children renders a square
|
|
40
|
+
button of the current `size`. There is no `size="icon"`.
|
|
41
|
+
|
|
42
|
+
`loading` keeps the button focusable instead of setting the native
|
|
43
|
+
`disabled` attribute (so `aria-busy` has somewhere to be announced to,
|
|
44
|
+
rather than blurring on a button the user just clicked) — clicks are still
|
|
45
|
+
suppressed, but only at the layer React's own `onClick` sits on. A raw DOM
|
|
46
|
+
listener attached via `ref`/`addEventListener` is not suppressed the same
|
|
47
|
+
way and WILL still fire while `loading` is true; wire button activation
|
|
48
|
+
through `onClick`, not a manual listener, if you need it to respect
|
|
49
|
+
`loading`.
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { Button } from '@gears-frontx/ui-kit';
|
|
55
|
+
|
|
56
|
+
// Primary action
|
|
57
|
+
<Button onClick={save}>Save</Button>
|
|
58
|
+
|
|
59
|
+
// Dangerous action
|
|
60
|
+
<Button variant="destructive" onClick={remove}>Delete</Button>
|
|
61
|
+
|
|
62
|
+
// Secondary action next to a primary one
|
|
63
|
+
<Button variant="outline" onClick={cancel}>Cancel</Button>
|
|
64
|
+
|
|
65
|
+
// Icon next to the label goes in the icon slot, never in children
|
|
66
|
+
<Button icon={<PlusIcon />} onClick={create}>New project</Button>
|
|
67
|
+
|
|
68
|
+
// Icon-only (icon slot + no children): always label it
|
|
69
|
+
<Button icon={<CrossIcon />} aria-label="Close" />
|
|
70
|
+
|
|
71
|
+
// Async action: loading disables and spins, width does not jump
|
|
72
|
+
<Button loading={saving} onClick={save}>Save</Button>
|
|
73
|
+
|
|
74
|
+
// Button-semantic action over a real anchor (announced as a button,
|
|
75
|
+
// cmd-clickable) — not for plain navigation
|
|
76
|
+
<Button render={<a href="/reports" />} nativeButton={false} variant="outline">
|
|
77
|
+
Open reports
|
|
78
|
+
</Button>
|
|
79
|
+
|
|
80
|
+
// Form submit (explicit type)
|
|
81
|
+
<Button type="submit">Create account</Button>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Anti-patterns
|
|
85
|
+
|
|
86
|
+
- Do not restyle via inline `style` or ad-hoc CSS — brand changes belong in
|
|
87
|
+
the theme tokens (`theme.css` CSS variables). If you rebrand the focus
|
|
88
|
+
ring specifically via `--button-focus-ring`, note that the `default` and
|
|
89
|
+
`destructive` variants also set an explicit `--button-focus-ring-inner`
|
|
90
|
+
of their own (a two-tone ring, needed to clear WCAG contrast against
|
|
91
|
+
their own fill) — overriding only `--button-focus-ring` on those two
|
|
92
|
+
leaves the old inner color in place instead of following it; set both
|
|
93
|
+
properties together when rebranding either variant's ring.
|
|
94
|
+
- Do not put an icon in `children` next to text — it lands in the `icon`
|
|
95
|
+
slot, which is what sizes it, spaces it, hides it during `loading`, and
|
|
96
|
+
keeps it out of the accessible name.
|
|
97
|
+
- Do not render an icon-only button (icon slot, no children) without
|
|
98
|
+
`aria-label` — the icon is decorative and carries no name.
|
|
99
|
+
- Do not emulate `loading` by swapping children for a spinner — the button
|
|
100
|
+
loses its accessible name and jumps in width; pass `loading`.
|
|
101
|
+
- Do not emulate disabled with CSS/`onClick` guards — pass `disabled`
|
|
102
|
+
(add `focusableWhenDisabled` if it must stay discoverable by keyboard).
|