@ashwa-io/ui 0.0.4 → 0.0.6
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/atomic/Button/buttonLook.js +18 -0
- package/dist/components/atomic/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/atomic/Tooltip/Tooltip.js +14 -0
- package/dist/components/atomic/Tooltip/index.d.ts +2 -0
- package/dist/components/molecule/ConfirmDialog/ConfirmDialog.d.ts +17 -0
- package/dist/components/molecule/ConfirmDialog/ConfirmDialog.js +28 -0
- package/dist/components/molecule/ConfirmDialog/index.d.ts +2 -0
- package/dist/components/molecule/DropdownMenu/DropdownMenu.d.ts +28 -0
- package/dist/components/molecule/DropdownMenu/DropdownMenu.js +53 -0
- package/dist/components/molecule/DropdownMenu/index.d.ts +2 -0
- package/dist/components/molecule/FacetFilter/FacetFilter.d.ts +14 -0
- package/dist/components/molecule/FacetFilter/FacetFilter.js +30 -0
- package/dist/components/molecule/FacetFilter/FacetList.d.ts +10 -0
- package/dist/components/molecule/FacetFilter/FacetList.js +103 -0
- package/dist/components/molecule/FacetFilter/FacetTrigger.d.ts +2 -0
- package/dist/components/molecule/FacetFilter/FacetTrigger.js +35 -0
- package/dist/components/molecule/FacetFilter/index.d.ts +3 -0
- package/dist/components/molecule/FacetFilterNumber/FacetFilterNumber.d.ts +29 -0
- package/dist/components/molecule/FacetFilterNumber/FacetFilterNumber.js +93 -0
- package/dist/components/molecule/FacetFilterNumber/index.d.ts +2 -0
- package/dist/components/molecule/FacetFilterSelect/FacetFilterSelect.d.ts +15 -0
- package/dist/components/molecule/FacetFilterSelect/FacetFilterSelect.js +41 -0
- package/dist/components/molecule/FacetFilterSelect/index.d.ts +2 -0
- package/dist/components/molecule/FilterMenu/FilterMenu.d.ts +23 -0
- package/dist/components/molecule/FilterMenu/FilterMenu.js +131 -0
- package/dist/components/molecule/FilterMenu/index.d.ts +2 -0
- package/dist/components/molecule/Modal/Modal.d.ts +22 -0
- package/dist/components/molecule/Modal/Modal.js +48 -0
- package/dist/components/molecule/Modal/index.d.ts +2 -0
- package/dist/components/molecule/Popover/Popover.d.ts +24 -0
- package/dist/components/molecule/Popover/Popover.js +38 -0
- package/dist/components/molecule/Popover/index.d.ts +2 -0
- package/dist/components/molecule/Toaster/Toaster.d.ts +3 -0
- package/dist/components/molecule/Toaster/Toaster.js +19 -0
- package/dist/components/molecule/Toaster/index.d.ts +3 -0
- package/dist/components/molecule/Toaster/toast.d.ts +13 -0
- package/dist/components/molecule/Toaster/toast.js +18 -0
- package/dist/components/ui/alert-dialog.js +61 -0
- package/dist/components/ui/combobox.js +78 -0
- package/dist/components/ui/dialog.js +78 -0
- package/dist/components/ui/dropdown-menu.js +42 -0
- package/dist/components/ui/input-group.js +63 -0
- package/dist/components/ui/popover.js +32 -0
- package/dist/components/ui/tooltip.js +39 -0
- package/dist/index.d.ts +24 -2
- package/dist/index.js +12 -1
- package/dist/lib/types.d.ts +4 -0
- package/dist/theme/brandTheme.d.ts +1 -1
- package/dist/theme/brandTheme.js +10 -8
- package/package.json +2 -1
- package/src/styles/index.css +45 -43
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { Input } from "./input.js";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import "react";
|
|
7
|
+
// src/components/ui/input-group.tsx
|
|
8
|
+
const InputGroup = ({ className, ...props }) => {
|
|
9
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
"data-slot": "input-group",
|
|
11
|
+
role: "group",
|
|
12
|
+
className: cn("group/input-group border-input has-disabled:bg-input/50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-8 w-full min-w-0 items-center rounded-lg border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
17
|
+
variants: { align: {
|
|
18
|
+
"inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
|
19
|
+
"inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
|
20
|
+
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
21
|
+
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
22
|
+
} },
|
|
23
|
+
defaultVariants: { align: "inline-start" }
|
|
24
|
+
});
|
|
25
|
+
const InputGroupAddon = ({ className, align = "inline-start", ...props }) => {
|
|
26
|
+
return /* @__PURE__ */ jsx("div", {
|
|
27
|
+
role: "group",
|
|
28
|
+
"data-slot": "input-group-addon",
|
|
29
|
+
"data-align": align,
|
|
30
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
31
|
+
onClick: (e) => {
|
|
32
|
+
if (e.target.closest("button")) return;
|
|
33
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
39
|
+
variants: { size: {
|
|
40
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
41
|
+
sm: "",
|
|
42
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
|
43
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
44
|
+
} },
|
|
45
|
+
defaultVariants: { size: "xs" }
|
|
46
|
+
});
|
|
47
|
+
const InputGroupButton = ({ className, type = "button", variant = "ghost", size = "xs", ...props }) => {
|
|
48
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
49
|
+
type,
|
|
50
|
+
"data-size": size,
|
|
51
|
+
variant,
|
|
52
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const InputGroupInput = ({ className, ...props }) => {
|
|
57
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
58
|
+
"data-slot": "input-group-control",
|
|
59
|
+
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Popover } from "@base-ui/react/popover";
|
|
5
|
+
// src/components/ui/popover.tsx
|
|
6
|
+
const Popover$1 = ({ ...props }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(Popover.Root, {
|
|
8
|
+
"data-slot": "popover",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
const PopoverTrigger = ({ ...props }) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
14
|
+
"data-slot": "popover-trigger",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const PopoverContent = ({ className, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, ...props }) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
20
|
+
align,
|
|
21
|
+
alignOffset,
|
|
22
|
+
side,
|
|
23
|
+
sideOffset,
|
|
24
|
+
className: "isolate z-50",
|
|
25
|
+
children: /* @__PURE__ */ jsx(Popover.Popup, {
|
|
26
|
+
"data-slot": "popover-content",
|
|
27
|
+
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg p-2.5 text-sm shadow-md ring-1 outline-hidden duration-100", className),
|
|
28
|
+
...props
|
|
29
|
+
})
|
|
30
|
+
}) });
|
|
31
|
+
};
|
|
32
|
+
export { Popover$1 as Popover, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip } from "@base-ui/react/tooltip";
|
|
4
|
+
// src/components/ui/tooltip.tsx
|
|
5
|
+
const TooltipProvider = ({ delay = 0, ...props }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(Tooltip.Provider, {
|
|
7
|
+
"data-slot": "tooltip-provider",
|
|
8
|
+
delay,
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
const Tooltip$1 = ({ ...props }) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(Tooltip.Root, {
|
|
14
|
+
"data-slot": "tooltip",
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const TooltipTrigger = ({ ...props }) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
20
|
+
"data-slot": "tooltip-trigger",
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const TooltipContent = ({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) => {
|
|
25
|
+
return /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
26
|
+
align,
|
|
27
|
+
alignOffset,
|
|
28
|
+
side,
|
|
29
|
+
sideOffset,
|
|
30
|
+
className: "isolate z-50",
|
|
31
|
+
children: /* @__PURE__ */ jsxs(Tooltip.Popup, {
|
|
32
|
+
"data-slot": "tooltip-content",
|
|
33
|
+
className: cn("bg-foreground text-background data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md px-3 py-1.5 text-xs has-data-[slot=kbd]:pr-1.5 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm", className),
|
|
34
|
+
...props,
|
|
35
|
+
children: [children, /* @__PURE__ */ jsx(Tooltip.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })]
|
|
36
|
+
})
|
|
37
|
+
}) });
|
|
38
|
+
};
|
|
39
|
+
export { Tooltip$1 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ import "./components/atomic/TextArea/index.js";
|
|
|
19
19
|
import { TextArea, TextAreaProps } from "./components/atomic/TextArea/TextArea.js";
|
|
20
20
|
import "./components/atomic/TextInput/index.js";
|
|
21
21
|
import { TextInput, TextInputProps, TextInputType } from "./components/atomic/TextInput/TextInput.js";
|
|
22
|
+
import "./components/atomic/Tooltip/index.js";
|
|
23
|
+
import { Tooltip, TooltipProps } from "./components/atomic/Tooltip/Tooltip.js";
|
|
22
24
|
import "./components/atomic/IconButton/index.js";
|
|
23
25
|
import { IconButton, IconButtonProps, IconButtonVariant } from "./components/atomic/IconButton/IconButton.js";
|
|
24
26
|
import "./components/atomic/Select/index.js";
|
|
@@ -29,9 +31,29 @@ import "./components/atomic/Spinner/index.js";
|
|
|
29
31
|
import { Spinner, SpinnerProps } from "./components/atomic/Spinner/Spinner.js";
|
|
30
32
|
import "./components/layout/FormLayout/index.js";
|
|
31
33
|
import { FormLayout, FormLayoutDirection, FormLayoutProps } from "./components/layout/FormLayout/FormLayout.js";
|
|
34
|
+
import "./components/molecule/ConfirmDialog/index.js";
|
|
35
|
+
import { ConfirmDialog, ConfirmDialogProps } from "./components/molecule/ConfirmDialog/ConfirmDialog.js";
|
|
36
|
+
import "./components/molecule/DropdownMenu/index.js";
|
|
37
|
+
import { DropdownMenu, DropdownMenuProps, MenuItem } from "./components/molecule/DropdownMenu/DropdownMenu.js";
|
|
38
|
+
import "./components/molecule/FacetFilter/index.js";
|
|
39
|
+
import { FacetOption } from "./components/molecule/FacetFilter/FacetList.js";
|
|
40
|
+
import { FacetFilter, FacetFilterProps } from "./components/molecule/FacetFilter/FacetFilter.js";
|
|
41
|
+
import "./components/molecule/FacetFilterSelect/index.js";
|
|
42
|
+
import { FacetFilterSelect, FacetFilterSelectProps } from "./components/molecule/FacetFilterSelect/FacetFilterSelect.js";
|
|
43
|
+
import "./components/molecule/FacetFilterNumber/index.js";
|
|
44
|
+
import { FacetFilterNumber, FacetFilterNumberProps, NumberCondition, NumberFilterValue } from "./components/molecule/FacetFilterNumber/FacetFilterNumber.js";
|
|
45
|
+
import "./components/molecule/FilterMenu/index.js";
|
|
46
|
+
import { FilterCategory, FilterMenu, FilterMenuProps, FilterMenuValue } from "./components/molecule/FilterMenu/FilterMenu.js";
|
|
32
47
|
import "./components/molecule/FormField/index.js";
|
|
33
48
|
import { FormField, FormFieldControlProps, FormFieldProps } from "./components/molecule/FormField/FormField.js";
|
|
49
|
+
import "./components/molecule/Modal/index.js";
|
|
50
|
+
import { Modal, ModalProps, ModalSize } from "./components/molecule/Modal/Modal.js";
|
|
51
|
+
import "./components/molecule/Popover/index.js";
|
|
52
|
+
import { Popover, PopoverProps, PopoverWidth } from "./components/molecule/Popover/Popover.js";
|
|
53
|
+
import "./components/molecule/Toaster/index.js";
|
|
54
|
+
import { ToastOptions, toast } from "./components/molecule/Toaster/toast.js";
|
|
55
|
+
import { Toaster } from "./components/molecule/Toaster/Toaster.js";
|
|
34
56
|
import "./components/layout/Stack/index.js";
|
|
35
57
|
import { HStack, HStackProps, Stack, StackAlign, StackGap, StackJustify, StackProps, VStack, VStackProps } from "./components/layout/Stack/Stack.js";
|
|
36
|
-
import { FieldBaseProps, IconComponent, Size, Tone } from "./lib/types.js";
|
|
37
|
-
export { Badge, type BadgeProps, Button, type ButtonProps, type ButtonVariant, Checkbox, type CheckboxProps, ColorInput, type ColorInputProps, Divider, type DividerProps, type FieldBaseProps, FormField, type FormFieldControlProps, type FormFieldProps, FormLayout, type FormLayoutDirection, type FormLayoutProps, HStack, type HStackProps, Heading, type HeadingLevel, type HeadingProps, IconButton, type IconButtonProps, type IconButtonVariant, type IconComponent, Select, type SelectOption, type SelectProps, type Size, Skeleton, type SkeletonProps, type SkeletonShape, Spinner, type SpinnerProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextInputType, type TextProps, type TextSize, type TextTone, type TextWeight, type Tone, VStack, type VStackProps };
|
|
58
|
+
import { FieldBaseProps, IconComponent, OverlayAlign, OverlaySide, Size, Tone } from "./lib/types.js";
|
|
59
|
+
export { Badge, type BadgeProps, Button, type ButtonProps, type ButtonVariant, Checkbox, type CheckboxProps, ColorInput, type ColorInputProps, ConfirmDialog, type ConfirmDialogProps, Divider, type DividerProps, DropdownMenu, type DropdownMenuProps, FacetFilter, FacetFilterNumber, type FacetFilterNumberProps, type FacetFilterProps, FacetFilterSelect, type FacetFilterSelectProps, type FacetOption, type FieldBaseProps, type FilterCategory, FilterMenu, type FilterMenuProps, type FilterMenuValue, FormField, type FormFieldControlProps, type FormFieldProps, FormLayout, type FormLayoutDirection, type FormLayoutProps, HStack, type HStackProps, Heading, type HeadingLevel, type HeadingProps, IconButton, type IconButtonProps, type IconButtonVariant, type IconComponent, type MenuItem, Modal, type ModalProps, type ModalSize, type NumberCondition, type NumberFilterValue, type OverlayAlign, type OverlaySide, Popover, type PopoverProps, type PopoverWidth, Select, type SelectOption, type SelectProps, type Size, Skeleton, type SkeletonProps, type SkeletonShape, Spinner, type SpinnerProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextInputType, type TextProps, type TextSize, type TextTone, type TextWeight, type ToastOptions, Toaster, type Tone, Tooltip, type TooltipProps, VStack, type VStackProps, toast };
|
package/dist/index.js
CHANGED
|
@@ -8,11 +8,22 @@ import { Switch } from "./components/atomic/Switch/Switch.js";
|
|
|
8
8
|
import { Text } from "./components/atomic/Text/Text.js";
|
|
9
9
|
import { TextArea } from "./components/atomic/TextArea/TextArea.js";
|
|
10
10
|
import { TextInput } from "./components/atomic/TextInput/TextInput.js";
|
|
11
|
+
import { Tooltip } from "./components/atomic/Tooltip/Tooltip.js";
|
|
11
12
|
import { IconButton } from "./components/atomic/IconButton/IconButton.js";
|
|
12
13
|
import { Select } from "./components/atomic/Select/Select.js";
|
|
13
14
|
import { Skeleton } from "./components/atomic/Skeleton/Skeleton.js";
|
|
14
15
|
import { Spinner } from "./components/atomic/Spinner/Spinner.js";
|
|
15
16
|
import { FormLayout } from "./components/layout/FormLayout/FormLayout.js";
|
|
17
|
+
import { ConfirmDialog } from "./components/molecule/ConfirmDialog/ConfirmDialog.js";
|
|
18
|
+
import { DropdownMenu } from "./components/molecule/DropdownMenu/DropdownMenu.js";
|
|
19
|
+
import { FacetFilter } from "./components/molecule/FacetFilter/FacetFilter.js";
|
|
20
|
+
import { FacetFilterSelect } from "./components/molecule/FacetFilterSelect/FacetFilterSelect.js";
|
|
21
|
+
import { FacetFilterNumber } from "./components/molecule/FacetFilterNumber/FacetFilterNumber.js";
|
|
22
|
+
import { FilterMenu } from "./components/molecule/FilterMenu/FilterMenu.js";
|
|
16
23
|
import { FormField } from "./components/molecule/FormField/FormField.js";
|
|
24
|
+
import { Modal } from "./components/molecule/Modal/Modal.js";
|
|
25
|
+
import { Popover } from "./components/molecule/Popover/Popover.js";
|
|
26
|
+
import { toast } from "./components/molecule/Toaster/toast.js";
|
|
27
|
+
import { Toaster } from "./components/molecule/Toaster/Toaster.js";
|
|
17
28
|
import { HStack, Stack, VStack } from "./components/layout/Stack/Stack.js";
|
|
18
|
-
export { Badge, Button, Checkbox, ColorInput, Divider, FormField, FormLayout, HStack, Heading, IconButton, Select, Skeleton, Spinner, Stack, Switch, Text, TextArea, TextInput, VStack };
|
|
29
|
+
export { Badge, Button, Checkbox, ColorInput, ConfirmDialog, Divider, DropdownMenu, FacetFilter, FacetFilterNumber, FacetFilterSelect, FilterMenu, FormField, FormLayout, HStack, Heading, IconButton, Modal, Popover, Select, Skeleton, Spinner, Stack, Switch, Text, TextArea, TextInput, Toaster, Tooltip, VStack, toast };
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import React from "react";
|
|
|
2
2
|
/** Shared size scale for every public component. */
|
|
3
3
|
export type Size = 'sm' | 'md' | 'lg';
|
|
4
4
|
export type Tone = 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info';
|
|
5
|
+
/** Which side of the trigger an overlay opens on. */
|
|
6
|
+
export type OverlaySide = 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
+
/** How an overlay lines up with its trigger along that side. */
|
|
8
|
+
export type OverlayAlign = 'start' | 'center' | 'end';
|
|
5
9
|
/** An icon component (lucide-react, svgr): the design system controls its size and colour. */
|
|
6
10
|
export type IconComponent = React.ComponentType<{
|
|
7
11
|
className?: string;
|
package/dist/theme/brandTheme.js
CHANGED
|
@@ -4,7 +4,7 @@ useMode(modeRgb);
|
|
|
4
4
|
useMode(modeLrgb);
|
|
5
5
|
useMode(modeOklab);
|
|
6
6
|
useMode(modeOklch);
|
|
7
|
-
const DEFAULT_BRAND_HEX = "#
|
|
7
|
+
const DEFAULT_BRAND_HEX = "#8556ef";
|
|
8
8
|
const SURFACES = {
|
|
9
9
|
light: [{
|
|
10
10
|
mode: "oklch",
|
|
@@ -13,12 +13,14 @@ const SURFACES = {
|
|
|
13
13
|
}],
|
|
14
14
|
dark: [{
|
|
15
15
|
mode: "oklch",
|
|
16
|
-
l: .
|
|
17
|
-
c:
|
|
16
|
+
l: .141,
|
|
17
|
+
c: .005,
|
|
18
|
+
h: 285.823
|
|
18
19
|
}, {
|
|
19
20
|
mode: "oklch",
|
|
20
|
-
l: .
|
|
21
|
-
c:
|
|
21
|
+
l: .21,
|
|
22
|
+
c: .006,
|
|
23
|
+
h: 285.885
|
|
22
24
|
}]
|
|
23
25
|
};
|
|
24
26
|
const DIRECTION = {
|
|
@@ -48,7 +50,7 @@ const BLACK = {
|
|
|
48
50
|
c: 0
|
|
49
51
|
};
|
|
50
52
|
const MIN_UI_CONTRAST = 3;
|
|
51
|
-
const MIN_TEXT_CONTRAST = 4.
|
|
53
|
+
const MIN_TEXT_CONTRAST = 4.55;
|
|
52
54
|
const LIGHTNESS_STEP = .005;
|
|
53
55
|
const MAX_STEPS = 200;
|
|
54
56
|
const WHITE_LABEL_MAX_STEPS = 10;
|
|
@@ -137,10 +139,10 @@ const parseBrand = (hex) => {
|
|
|
137
139
|
};
|
|
138
140
|
/** Brand tokens for light and dark from one org hex. Never throws; bad input → default. */
|
|
139
141
|
const brandTheme = (hex) => {
|
|
140
|
-
const input = parseBrand(hex ?? "#
|
|
142
|
+
const input = parseBrand(hex ?? "#8556ef");
|
|
141
143
|
if (input) return buildTheme(input);
|
|
142
144
|
return {
|
|
143
|
-
...buildTheme(parseBrand("#
|
|
145
|
+
...buildTheme(parseBrand("#8556ef") ?? BLACK),
|
|
144
146
|
warnings: ["invalid"]
|
|
145
147
|
};
|
|
146
148
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashwa-io/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Ashwa design system: locked React components on shadcn/ui (Base UI) and Tailwind v4, with per-org brand theming.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"class-variance-authority": "^0.7.1",
|
|
103
103
|
"cn": "^0.5.2",
|
|
104
104
|
"culori": "^4.0.2",
|
|
105
|
+
"sonner": "^2.0.8",
|
|
105
106
|
"tw-animate-css": "^1.4.0"
|
|
106
107
|
}
|
|
107
108
|
}
|
package/src/styles/index.css
CHANGED
|
@@ -64,27 +64,27 @@
|
|
|
64
64
|
:root {
|
|
65
65
|
/* Brand group: defaults = brandTheme(DEFAULT_BRAND_HEX). Per-org values come from
|
|
66
66
|
brandThemeCss(hex) in @ashwa-io/ui/theme, injected at runtime, and outrank these. */
|
|
67
|
-
--brand: oklch(0.
|
|
67
|
+
--brand: oklch(0.586 0.218 292.5);
|
|
68
68
|
--brand-foreground: oklch(1 0 0);
|
|
69
|
-
--brand-text: oklch(0.
|
|
70
|
-
--brand-tint: oklch(0.965 0.018
|
|
71
|
-
--brand-tint-foreground: oklch(0.
|
|
72
|
-
--brand-map: #
|
|
69
|
+
--brand-text: oklch(0.586 0.218 292.5);
|
|
70
|
+
--brand-tint: oklch(0.965 0.018 292.5);
|
|
71
|
+
--brand-tint-foreground: oklch(0.561 0.218 292.5);
|
|
72
|
+
--brand-map: #8556ef;
|
|
73
73
|
|
|
74
74
|
--background: oklch(1 0 0);
|
|
75
|
-
--foreground: oklch(0.
|
|
75
|
+
--foreground: oklch(0.141 0.005 285.823);
|
|
76
76
|
--card: oklch(1 0 0);
|
|
77
|
-
--card-foreground: oklch(0.
|
|
77
|
+
--card-foreground: oklch(0.141 0.005 285.823);
|
|
78
78
|
--popover: oklch(1 0 0);
|
|
79
|
-
--popover-foreground: oklch(0.
|
|
79
|
+
--popover-foreground: oklch(0.141 0.005 285.823);
|
|
80
80
|
--primary: var(--brand);
|
|
81
81
|
--primary-foreground: var(--brand-foreground);
|
|
82
|
-
--secondary: oklch(0.
|
|
83
|
-
--secondary-foreground: oklch(0.
|
|
84
|
-
--muted: oklch(0.
|
|
85
|
-
--muted-foreground: oklch(0.
|
|
86
|
-
--accent: oklch(0.
|
|
87
|
-
--accent-foreground: oklch(0.
|
|
82
|
+
--secondary: oklch(0.967 0.001 286.375);
|
|
83
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
84
|
+
--muted: oklch(0.967 0.001 286.375);
|
|
85
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
|
86
|
+
--accent: oklch(0.967 0.001 286.375);
|
|
87
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
88
88
|
/* Tailwind red-700, darker than base-nova's red-600: destructive text on its 10% tint
|
|
89
89
|
(Button destructive) must reach WCAG AA 4.5:1; red-600 only reached 4:1. */
|
|
90
90
|
--destructive: oklch(0.505 0.213 27.518);
|
|
@@ -93,58 +93,60 @@
|
|
|
93
93
|
--success: oklch(0.448 0.119 151.328);
|
|
94
94
|
--warning: oklch(0.473 0.137 46.201);
|
|
95
95
|
--info: oklch(0.488 0.243 264.376);
|
|
96
|
-
--border: oklch(0.
|
|
97
|
-
--input: oklch(0.
|
|
96
|
+
--border: oklch(0.92 0.004 286.32);
|
|
97
|
+
--input: oklch(0.92 0.004 286.32);
|
|
98
98
|
--ring: var(--brand);
|
|
99
99
|
--chart-1: var(--brand);
|
|
100
|
-
--chart-2: oklch(0.
|
|
101
|
-
--chart-3: oklch(0.
|
|
102
|
-
--chart-4: oklch(0.
|
|
103
|
-
--chart-5: oklch(0.
|
|
100
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
101
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
102
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
103
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
104
104
|
--radius: 0.5rem;
|
|
105
105
|
--sidebar: oklch(0.985 0 0);
|
|
106
|
-
--sidebar-foreground: oklch(0.
|
|
106
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823);
|
|
107
107
|
--sidebar-primary: var(--brand);
|
|
108
108
|
--sidebar-primary-foreground: var(--brand-foreground);
|
|
109
|
-
--sidebar-accent: oklch(0.
|
|
110
|
-
--sidebar-accent-foreground: oklch(0.
|
|
111
|
-
--sidebar-border: oklch(0.
|
|
109
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
110
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
111
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
112
112
|
--sidebar-ring: var(--brand);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
.dark {
|
|
116
|
-
--brand: oklch(0.
|
|
116
|
+
--brand: oklch(0.586 0.218 292.5);
|
|
117
117
|
--brand-foreground: oklch(1 0 0);
|
|
118
|
-
--brand-text: oklch(0.
|
|
119
|
-
--brand-tint: oklch(0.3 0.04
|
|
120
|
-
--brand-tint-foreground: oklch(0.
|
|
121
|
-
--brand-map: #
|
|
118
|
+
--brand-text: oklch(0.626 0.218 292.5);
|
|
119
|
+
--brand-tint: oklch(0.3 0.04 292.5);
|
|
120
|
+
--brand-tint-foreground: oklch(0.686 0.181 292.5);
|
|
121
|
+
--brand-map: #8556ef;
|
|
122
122
|
|
|
123
|
-
--background: oklch(0.
|
|
123
|
+
--background: oklch(0.141 0.005 285.823);
|
|
124
124
|
--foreground: oklch(0.985 0 0);
|
|
125
|
-
--card: oklch(0.
|
|
125
|
+
--card: oklch(0.21 0.006 285.885);
|
|
126
126
|
--card-foreground: oklch(0.985 0 0);
|
|
127
|
-
--popover: oklch(0.
|
|
127
|
+
--popover: oklch(0.21 0.006 285.885);
|
|
128
128
|
--popover-foreground: oklch(0.985 0 0);
|
|
129
|
-
--secondary: oklch(0.
|
|
129
|
+
--secondary: oklch(0.274 0.006 286.033);
|
|
130
130
|
--secondary-foreground: oklch(0.985 0 0);
|
|
131
|
-
--muted: oklch(0.
|
|
132
|
-
--muted-foreground: oklch(0.
|
|
133
|
-
--accent: oklch(0.
|
|
131
|
+
--muted: oklch(0.274 0.006 286.033);
|
|
132
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
|
133
|
+
--accent: oklch(0.274 0.006 286.033);
|
|
134
134
|
--accent-foreground: oklch(0.985 0 0);
|
|
135
|
-
|
|
135
|
+
/* Lighter than nigam's red-400: destructive text on its 20% tint must reach 4.5:1 on dialog
|
|
136
|
+
footers (red-400 only reached 4.2). */
|
|
137
|
+
--destructive: oklch(0.76 0.191 22.216);
|
|
136
138
|
--success: oklch(0.792 0.209 151.711);
|
|
137
139
|
--warning: oklch(0.828 0.189 84.429);
|
|
138
140
|
--info: oklch(0.707 0.165 254.624);
|
|
139
141
|
--border: oklch(1 0 0 / 10%);
|
|
140
142
|
--input: oklch(1 0 0 / 15%);
|
|
141
|
-
--chart-2: oklch(0.
|
|
142
|
-
--chart-3: oklch(0.
|
|
143
|
-
--chart-4: oklch(0.
|
|
144
|
-
--chart-5: oklch(0.
|
|
145
|
-
--sidebar: oklch(0.
|
|
143
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
144
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
145
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
146
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
147
|
+
--sidebar: oklch(0.21 0.006 285.885);
|
|
146
148
|
--sidebar-foreground: oklch(0.985 0 0);
|
|
147
|
-
--sidebar-accent: oklch(0.
|
|
149
|
+
--sidebar-accent: oklch(0.274 0.006 286.033);
|
|
148
150
|
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
149
151
|
--sidebar-border: oklch(1 0 0 / 10%);
|
|
150
152
|
}
|