@dirstack/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/components/animated-number.d.ts +18 -0
- package/dist/components/animated-number.d.ts.map +1 -0
- package/dist/components/animated-number.js +29 -0
- package/dist/components/animated-number.js.map +1 -0
- package/dist/components/avatar.d.ts +8 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +27 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +58 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +51 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.d.ts +63 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +66 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/callout.d.ts +41 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +49 -0
- package/dist/components/callout.js.map +1 -0
- package/dist/components/card.d.ts +61 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +67 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/chart.d.ts +32 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +121 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/copy-button.d.ts +22 -0
- package/dist/components/copy-button.d.ts.map +1 -0
- package/dist/components/copy-button.js +50 -0
- package/dist/components/copy-button.js.map +1 -0
- package/dist/components/copy-input.d.ts +13 -0
- package/dist/components/copy-input.d.ts.map +1 -0
- package/dist/components/copy-input.js +28 -0
- package/dist/components/copy-input.js.map +1 -0
- package/dist/components/detail-row.d.ts +93 -0
- package/dist/components/detail-row.d.ts.map +1 -0
- package/dist/components/detail-row.js +69 -0
- package/dist/components/detail-row.js.map +1 -0
- package/dist/components/dialog.d.ts +173 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +139 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/empty-state.d.ts +96 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +69 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/entity-avatar.d.ts +77 -0
- package/dist/components/entity-avatar.d.ts.map +1 -0
- package/dist/components/entity-avatar.js +48 -0
- package/dist/components/entity-avatar.js.map +1 -0
- package/dist/components/form-row.d.ts +35 -0
- package/dist/components/form-row.d.ts.map +1 -0
- package/dist/components/form-row.js +46 -0
- package/dist/components/form-row.js.map +1 -0
- package/dist/components/form-section.d.ts +24 -0
- package/dist/components/form-section.d.ts.map +1 -0
- package/dist/components/form-section.js +39 -0
- package/dist/components/form-section.js.map +1 -0
- package/dist/components/form.d.ts +28 -0
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +88 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/heading.d.ts +44 -0
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/heading.js +45 -0
- package/dist/components/heading.js.map +1 -0
- package/dist/components/input.d.ts +55 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +33 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/kbd.d.ts +28 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +31 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +21 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +21 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menu.d.ts +22 -0
- package/dist/components/menu.d.ts.map +1 -0
- package/dist/components/menu.js +73 -0
- package/dist/components/menu.js.map +1 -0
- package/dist/components/nav-button.d.ts +34 -0
- package/dist/components/nav-button.d.ts.map +1 -0
- package/dist/components/nav-button.js +70 -0
- package/dist/components/nav-button.js.map +1 -0
- package/dist/components/nav.d.ts +44 -0
- package/dist/components/nav.d.ts.map +1 -0
- package/dist/components/nav.js +53 -0
- package/dist/components/nav.js.map +1 -0
- package/dist/components/number-input.d.ts +18 -0
- package/dist/components/number-input.d.ts.map +1 -0
- package/dist/components/number-input.js +25 -0
- package/dist/components/number-input.js.map +1 -0
- package/dist/components/page.d.ts +24 -0
- package/dist/components/page.d.ts.map +1 -0
- package/dist/components/page.js +24 -0
- package/dist/components/page.js.map +1 -0
- package/dist/components/pagination.d.ts +17 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +63 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +8 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +24 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/search-input.d.ts +14 -0
- package/dist/components/search-input.d.ts.map +1 -0
- package/dist/components/search-input.js +36 -0
- package/dist/components/search-input.js.map +1 -0
- package/dist/components/section-header.d.ts +107 -0
- package/dist/components/section-header.d.ts.map +1 -0
- package/dist/components/section-header.js +147 -0
- package/dist/components/section-header.js.map +1 -0
- package/dist/components/select.d.ts +17 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +94 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +13 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/stack.d.ts +54 -0
- package/dist/components/stack.d.ts.map +1 -0
- package/dist/components/stack.js +46 -0
- package/dist/components/stack.js.map +1 -0
- package/dist/components/stat-strip.d.ts +38 -0
- package/dist/components/stat-strip.d.ts.map +1 -0
- package/dist/components/stat-strip.js +57 -0
- package/dist/components/stat-strip.js.map +1 -0
- package/dist/components/steps.d.ts +19 -0
- package/dist/components/steps.d.ts.map +1 -0
- package/dist/components/steps.js +29 -0
- package/dist/components/steps.js.map +1 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +17 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/tabs.d.ts +62 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +64 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +18 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toaster.d.ts +6 -0
- package/dist/components/toaster.d.ts.map +1 -0
- package/dist/components/toaster.js +37 -0
- package/dist/components/toaster.js.map +1 -0
- package/dist/components/tooltip.d.ts +15 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +41 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/lib/animation.d.ts +12 -0
- package/dist/lib/animation.d.ts.map +1 -0
- package/dist/lib/animation.js +14 -0
- package/dist/lib/animation.js.map +1 -0
- package/dist/lib/classes.d.ts +29 -0
- package/dist/lib/classes.d.ts.map +1 -0
- package/dist/lib/classes.js +39 -0
- package/dist/lib/classes.js.map +1 -0
- package/dist/lib/icons.d.ts +21 -0
- package/dist/lib/icons.d.ts.map +1 -0
- package/dist/lib/icons.js +43 -0
- package/dist/lib/icons.js.map +1 -0
- package/dist/lib/interactive.d.ts +41 -0
- package/dist/lib/interactive.d.ts.map +1 -0
- package/dist/lib/interactive.js +30 -0
- package/dist/lib/interactive.js.map +1 -0
- package/dist/lib/slot.d.ts +12 -0
- package/dist/lib/slot.d.ts.map +1 -0
- package/dist/lib/slot.js +19 -0
- package/dist/lib/slot.js.map +1 -0
- package/dist/lib/variants.d.ts +3 -0
- package/dist/lib/variants.js +3 -0
- package/dist/styles.css +169 -0
- package/package.json +112 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","names":[],"sources":["../../src/lib/icons.tsx"],"mappings":";;;YAmBY,YAAY,KAAK;YACjB,gBAAgB,cAAc;qBAqB7B,WAAS;qBACT,iBAAe;qBACf,iBAAe;qBACf,kBAAgB;qBAChB,eAAa;qBACb,oBAAkB;qBAClB,iBAAe;qBACf,gBAAc;qBACd,YAAU;qBACV,aAAW;qBACX,UAAQ;qBACR,YAAU;qBACV,YAAU;qBACV,OAAK"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowDown01Icon, ArrowLeft01Icon, ArrowRight01Icon, ArrowUp01Icon, Cancel01Icon, CancelCircleIcon, CheckmarkCircle02Icon, CircleIcon as CircleIcon$1, Copy01Icon, HelpCircleIcon, Loading03Icon, Search01Icon, Tick02Icon, UnfoldMoreIcon } from "@hugeicons/core-free-icons";
|
|
3
|
+
import { HugeiconsIcon } from "@hugeicons/react";
|
|
4
|
+
//#region src/lib/icons.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Internal, non-exported icon helper. The package deliberately ships no public icon registry
|
|
7
|
+
* (icon choice is product-specific and lives in each consuming app); this file only carries the
|
|
8
|
+
* handful of structural glyphs the package's own components render. It lives in `lib/` rather
|
|
9
|
+
* than `components/` so the `"./*": "./dist/components/*"` wildcard export never exposes it.
|
|
10
|
+
*
|
|
11
|
+
* Wraps a Hugeicons definition as a plain icon component, so call sites render `<CheckIcon />`.
|
|
12
|
+
* Sizes to `1em` so a `size-*` class or the surrounding font size drives it.
|
|
13
|
+
*/
|
|
14
|
+
function icon(def, name) {
|
|
15
|
+
function Icon(props) {
|
|
16
|
+
return /* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
17
|
+
icon: def,
|
|
18
|
+
size: "1em",
|
|
19
|
+
strokeWidth: 1.75,
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
Icon.displayName = name;
|
|
24
|
+
return Icon;
|
|
25
|
+
}
|
|
26
|
+
const CheckIcon = icon(Tick02Icon, "CheckIcon");
|
|
27
|
+
const ChevronDownIcon = icon(ArrowDown01Icon, "ChevronDownIcon");
|
|
28
|
+
const ChevronLeftIcon = icon(ArrowLeft01Icon, "ChevronLeftIcon");
|
|
29
|
+
const ChevronRightIcon = icon(ArrowRight01Icon, "ChevronRightIcon");
|
|
30
|
+
const ChevronUpIcon = icon(ArrowUp01Icon, "ChevronUpIcon");
|
|
31
|
+
const ChevronsUpDownIcon = icon(UnfoldMoreIcon, "ChevronsUpDownIcon");
|
|
32
|
+
const CircleCheckIcon = icon(CheckmarkCircle02Icon, "CircleCheckIcon");
|
|
33
|
+
const CircleHelpIcon = icon(HelpCircleIcon, "CircleHelpIcon");
|
|
34
|
+
const CircleIcon = icon(CircleIcon$1, "CircleIcon");
|
|
35
|
+
const CircleXIcon = icon(CancelCircleIcon, "CircleXIcon");
|
|
36
|
+
const CopyIcon = icon(Copy01Icon, "CopyIcon");
|
|
37
|
+
const LoaderIcon = icon(Loading03Icon, "LoaderIcon");
|
|
38
|
+
const SearchIcon = icon(Search01Icon, "SearchIcon");
|
|
39
|
+
const XIcon = icon(Cancel01Icon, "XIcon");
|
|
40
|
+
//#endregion
|
|
41
|
+
export { CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleCheckIcon, CircleHelpIcon, CircleIcon, CircleXIcon, CopyIcon, LoaderIcon, SearchIcon, XIcon };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","names":["CircleDef"],"sources":["../../src/lib/icons.tsx"],"sourcesContent":["import {\n ArrowDown01Icon,\n ArrowLeft01Icon,\n ArrowRight01Icon,\n ArrowUp01Icon,\n Cancel01Icon,\n CancelCircleIcon,\n CheckmarkCircle02Icon,\n CircleIcon as CircleDef,\n Copy01Icon,\n HelpCircleIcon,\n Loading03Icon,\n Search01Icon,\n Tick02Icon,\n UnfoldMoreIcon,\n} from \"@hugeicons/core-free-icons\"\nimport { HugeiconsIcon, type HugeiconsProps, type IconSvgElement } from \"@hugeicons/react\"\nimport type { ComponentType } from \"react\"\n\nexport type IconProps = Omit<HugeiconsProps, \"icon\" | \"altIcon\" | \"showAlt\">\nexport type IconComponent = ComponentType<IconProps>\n\n/**\n * Internal, non-exported icon helper. The package deliberately ships no public icon registry\n * (icon choice is product-specific and lives in each consuming app); this file only carries the\n * handful of structural glyphs the package's own components render. It lives in `lib/` rather\n * than `components/` so the `\"./*\": \"./dist/components/*\"` wildcard export never exposes it.\n *\n * Wraps a Hugeicons definition as a plain icon component, so call sites render `<CheckIcon />`.\n * Sizes to `1em` so a `size-*` class or the surrounding font size drives it.\n */\nfunction icon(def: IconSvgElement, name: string): IconComponent {\n function Icon(props: IconProps) {\n return <HugeiconsIcon icon={def} size=\"1em\" strokeWidth={1.75} {...props} />\n }\n\n Icon.displayName = name\n\n return Icon\n}\n\nexport const CheckIcon = icon(Tick02Icon, \"CheckIcon\")\nexport const ChevronDownIcon = icon(ArrowDown01Icon, \"ChevronDownIcon\")\nexport const ChevronLeftIcon = icon(ArrowLeft01Icon, \"ChevronLeftIcon\")\nexport const ChevronRightIcon = icon(ArrowRight01Icon, \"ChevronRightIcon\")\nexport const ChevronUpIcon = icon(ArrowUp01Icon, \"ChevronUpIcon\")\nexport const ChevronsUpDownIcon = icon(UnfoldMoreIcon, \"ChevronsUpDownIcon\")\nexport const CircleCheckIcon = icon(CheckmarkCircle02Icon, \"CircleCheckIcon\")\nexport const CircleHelpIcon = icon(HelpCircleIcon, \"CircleHelpIcon\")\nexport const CircleIcon = icon(CircleDef, \"CircleIcon\")\nexport const CircleXIcon = icon(CancelCircleIcon, \"CircleXIcon\")\nexport const CopyIcon = icon(Copy01Icon, \"CopyIcon\")\nexport const LoaderIcon = icon(Loading03Icon, \"LoaderIcon\")\nexport const SearchIcon = icon(Search01Icon, \"SearchIcon\")\nexport const XIcon = icon(Cancel01Icon, \"XIcon\")\n"],"mappings":";;;;;;;;;;;;;AA+BA,SAAS,KAAK,KAAqB,MAA6B;CAC9D,SAAS,KAAK,OAAkB;EAC9B,OAAO,oBAAC,eAAD;GAAe,MAAM;GAAK,MAAK;GAAM,aAAa;GAAM,GAAI;EAAQ,CAAA;CAC7E;CAEA,KAAK,cAAc;CAEnB,OAAO;AACT;AAEA,MAAa,YAAY,KAAK,YAAY,WAAW;AACrD,MAAa,kBAAkB,KAAK,iBAAiB,iBAAiB;AACtE,MAAa,kBAAkB,KAAK,iBAAiB,iBAAiB;AACtE,MAAa,mBAAmB,KAAK,kBAAkB,kBAAkB;AACzE,MAAa,gBAAgB,KAAK,eAAe,eAAe;AAChE,MAAa,qBAAqB,KAAK,gBAAgB,oBAAoB;AAC3E,MAAa,kBAAkB,KAAK,uBAAuB,iBAAiB;AAC5E,MAAa,iBAAiB,KAAK,gBAAgB,gBAAgB;AACnE,MAAa,aAAa,KAAKA,cAAW,YAAY;AACtD,MAAa,cAAc,KAAK,kBAAkB,aAAa;AAC/D,MAAa,WAAW,KAAK,YAAY,UAAU;AACnD,MAAa,aAAa,KAAK,eAAe,YAAY;AAC1D,MAAa,aAAa,KAAK,cAAc,YAAY;AACzD,MAAa,QAAQ,KAAK,cAAc,OAAO"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/lib/interactive.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The hover and focus treatment every interactive surface shares (buttons, inputs, select
|
|
4
|
+
* triggers, switches, tabs): a soft 3px outline, plus a stronger border on surfaces that draw
|
|
5
|
+
* one (`bordered`). Borderless surfaces keep a transparent border of the same width, so
|
|
6
|
+
* nothing shifts between states. Components layer their own colors on top with `cn`, which
|
|
7
|
+
* resolves conflicting utilities in order, so no `!important` is needed.
|
|
8
|
+
*/
|
|
9
|
+
export declare const interactiveVariants: import("tailwind-variants").TVReturnType<{
|
|
10
|
+
hover: {
|
|
11
|
+
true: "not-disabled:cursor-pointer hover:not-disabled:outline-[3px] hover:not-disabled:outline-border/50";
|
|
12
|
+
};
|
|
13
|
+
focus: {
|
|
14
|
+
true: "focus-visible:outline-[3px] focus-visible:outline-border/50";
|
|
15
|
+
};
|
|
16
|
+
bordered: {
|
|
17
|
+
true: "border-border";
|
|
18
|
+
};
|
|
19
|
+
}, undefined, "border border-transparent outline-transparent", {
|
|
20
|
+
hover: {
|
|
21
|
+
true: "not-disabled:cursor-pointer hover:not-disabled:outline-[3px] hover:not-disabled:outline-border/50";
|
|
22
|
+
};
|
|
23
|
+
focus: {
|
|
24
|
+
true: "focus-visible:outline-[3px] focus-visible:outline-border/50";
|
|
25
|
+
};
|
|
26
|
+
bordered: {
|
|
27
|
+
true: "border-border";
|
|
28
|
+
};
|
|
29
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
30
|
+
hover: {
|
|
31
|
+
true: "not-disabled:cursor-pointer hover:not-disabled:outline-[3px] hover:not-disabled:outline-border/50";
|
|
32
|
+
};
|
|
33
|
+
focus: {
|
|
34
|
+
true: "focus-visible:outline-[3px] focus-visible:outline-border/50";
|
|
35
|
+
};
|
|
36
|
+
bordered: {
|
|
37
|
+
true: "border-border";
|
|
38
|
+
};
|
|
39
|
+
}, undefined>>;
|
|
40
|
+
//#endregion
|
|
41
|
+
//# sourceMappingURL=interactive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","names":[],"sources":["../../src/lib/interactive.ts"],"mappings":";;;;;;;;qBASa,iDAAmB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { variants } from "./variants.js";
|
|
2
|
+
//#region src/lib/interactive.ts
|
|
3
|
+
/**
|
|
4
|
+
* The hover and focus treatment every interactive surface shares (buttons, inputs, select
|
|
5
|
+
* triggers, switches, tabs): a soft 3px outline, plus a stronger border on surfaces that draw
|
|
6
|
+
* one (`bordered`). Borderless surfaces keep a transparent border of the same width, so
|
|
7
|
+
* nothing shifts between states. Components layer their own colors on top with `cn`, which
|
|
8
|
+
* resolves conflicting utilities in order, so no `!important` is needed.
|
|
9
|
+
*/
|
|
10
|
+
const interactiveVariants = variants({
|
|
11
|
+
base: "border border-transparent outline-transparent",
|
|
12
|
+
variants: {
|
|
13
|
+
hover: { true: "not-disabled:cursor-pointer hover:not-disabled:outline-[3px] hover:not-disabled:outline-border/50" },
|
|
14
|
+
focus: { true: "focus-visible:outline-[3px] focus-visible:outline-border/50" },
|
|
15
|
+
bordered: { true: "border-border" }
|
|
16
|
+
},
|
|
17
|
+
compoundVariants: [{
|
|
18
|
+
hover: true,
|
|
19
|
+
bordered: true,
|
|
20
|
+
class: "hover:not-disabled:border-ring"
|
|
21
|
+
}, {
|
|
22
|
+
focus: true,
|
|
23
|
+
bordered: true,
|
|
24
|
+
class: "focus-visible:border-ring"
|
|
25
|
+
}]
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { interactiveVariants };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=interactive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.js","names":[],"sources":["../../src/lib/interactive.ts"],"sourcesContent":["import { variants } from \"~/lib/variants\"\n\n/**\n * The hover and focus treatment every interactive surface shares (buttons, inputs, select\n * triggers, switches, tabs): a soft 3px outline, plus a stronger border on surfaces that draw\n * one (`bordered`). Borderless surfaces keep a transparent border of the same width, so\n * nothing shifts between states. Components layer their own colors on top with `cn`, which\n * resolves conflicting utilities in order, so no `!important` is needed.\n */\nexport const interactiveVariants = variants({\n base: \"border border-transparent outline-transparent\",\n\n variants: {\n hover: {\n true: \"not-disabled:cursor-pointer hover:not-disabled:outline-[3px] hover:not-disabled:outline-border/50\",\n },\n focus: {\n true: \"focus-visible:outline-[3px] focus-visible:outline-border/50\",\n },\n bordered: {\n true: \"border-border\",\n },\n },\n\n compoundVariants: [\n { hover: true, bordered: true, class: \"hover:not-disabled:border-ring\" },\n { focus: true, bordered: true, class: \"focus-visible:border-ring\" },\n ],\n})\n"],"mappings":";;;;;;;;;AASA,MAAa,sBAAsB,SAAS;CAC1C,MAAM;CAEN,UAAU;EACR,OAAO,EACL,MAAM,oGACR;EACA,OAAO,EACL,MAAM,8DACR;EACA,UAAU,EACR,MAAM,gBACR;CACF;CAEA,kBAAkB,CAChB;EAAE,OAAO;EAAM,UAAU;EAAM,OAAO;CAAiC,GACvE;EAAE,OAAO;EAAM,UAAU;EAAM,OAAO;CAA4B,CACpE;AACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/lib/slot.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Merges props onto a React element without adding a wrapper DOM node.
|
|
5
|
+
* Uses Base UI's `mergeProps` for type-safe className concatenation,
|
|
6
|
+
* event handler composition, and style merging.
|
|
7
|
+
*
|
|
8
|
+
* Returns the element as-is if it's not a valid React element (null, undefined, text).
|
|
9
|
+
*/
|
|
10
|
+
export declare function slot(element: ReactNode, props: Record<string, unknown>): ReactNode;
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.d.ts","names":[],"sources":["../../src/lib/slot.ts"],"mappings":";;;;;;;;;wBAUgB,KAAK,SAAS,WAAW,OAAO,0BAA0B"}
|
package/dist/lib/slot.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { mergeProps } from "@base-ui/react";
|
|
2
|
+
import { cloneElement, isValidElement } from "react";
|
|
3
|
+
//#region src/lib/slot.ts
|
|
4
|
+
/**
|
|
5
|
+
* Merges props onto a React element without adding a wrapper DOM node.
|
|
6
|
+
* Uses Base UI's `mergeProps` for type-safe className concatenation,
|
|
7
|
+
* event handler composition, and style merging.
|
|
8
|
+
*
|
|
9
|
+
* Returns the element as-is if it's not a valid React element (null, undefined, text).
|
|
10
|
+
*/
|
|
11
|
+
function slot(element, props) {
|
|
12
|
+
if (!isValidElement(element)) return element;
|
|
13
|
+
const el = element;
|
|
14
|
+
return cloneElement(el, mergeProps(props, el.props));
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { slot };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.js","names":[],"sources":["../../src/lib/slot.ts"],"sourcesContent":["import { mergeProps } from \"@base-ui/react\"\nimport { cloneElement, isValidElement, type ReactElement, type ReactNode } from \"react\"\n\n/**\n * Merges props onto a React element without adding a wrapper DOM node.\n * Uses Base UI's `mergeProps` for type-safe className concatenation,\n * event handler composition, and style merging.\n *\n * Returns the element as-is if it's not a valid React element (null, undefined, text).\n */\nexport function slot(element: ReactNode, props: Record<string, unknown>): ReactNode {\n if (!isValidElement(element)) {\n return element\n }\n\n const el = element as ReactElement<Record<string, unknown>>\n\n return cloneElement(el, mergeProps(props, el.props))\n}\n"],"mappings":";;;;;;;;;;AAUA,SAAgB,KAAK,SAAoB,OAA2C;CAClF,IAAI,CAAC,eAAe,OAAO,GACzB,OAAO;CAGT,MAAM,KAAK;CAEX,OAAO,aAAa,IAAI,WAAW,OAAO,GAAG,KAAK,CAAC;AACrD"}
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
@plugin "tailwindcss-animate";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Scan this library's own source for utility classes. `@source` resolves relative to
|
|
5
|
+
* THIS stylesheet, so the same directive works in both consumption modes:
|
|
6
|
+
* - built: node_modules/@dirstack/ui/dist/styles.css scans the sibling dist folder (.js)
|
|
7
|
+
* - source: @dirstack/ui/src/styles.css scans the sibling src folder (.ts, .tsx)
|
|
8
|
+
* Either way the class names baked into the components (bg-background,
|
|
9
|
+
* text-muted-foreground, the popover animation utilities, etc.) get generated.
|
|
10
|
+
* The consuming app still owns the `@import "tailwindcss"` in its own entry.
|
|
11
|
+
*/
|
|
12
|
+
@source "./";
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Every color is a `light-dark()` pair, resolved by the element's `color-scheme`: unset
|
|
16
|
+
* follows the OS, `[data-theme="dark"|"light"]` forces one (see the base layer below).
|
|
17
|
+
* One declaration per token, no duplicated palette. The token set mirrors shadcn/ui
|
|
18
|
+
* (background … sidebar-ring, chart-1…5) so app themes port over unchanged; the
|
|
19
|
+
* success/warning/danger trios are this library's additions.
|
|
20
|
+
*/
|
|
21
|
+
@theme {
|
|
22
|
+
--system-font:
|
|
23
|
+
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
24
|
+
"Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
|
25
|
+
"Segoe UI Symbol", "Noto Color Emoji";
|
|
26
|
+
|
|
27
|
+
--color-background: light-dark(oklch(0.985 0.001 106.423), oklch(0.147 0.004 49.25));
|
|
28
|
+
--color-foreground: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
29
|
+
--color-card: light-dark(oklch(1 0 0), oklch(0.216 0.006 56.043));
|
|
30
|
+
--color-card-foreground: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
31
|
+
--color-popover: light-dark(oklch(1 0 0), oklch(0.216 0.006 56.043));
|
|
32
|
+
--color-popover-foreground: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
33
|
+
--color-primary: light-dark(oklch(0.205 0 0), oklch(0.97 0.001 106.424));
|
|
34
|
+
--color-primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.205 0 0));
|
|
35
|
+
--color-secondary: light-dark(oklch(0.97 0.001 106.424), oklch(0.268 0.007 34.298));
|
|
36
|
+
--color-secondary-foreground: light-dark(oklch(0.371 0 0), oklch(0.985 0 0));
|
|
37
|
+
--color-muted: light-dark(oklch(0.97 0.001 106.424), oklch(0.268 0.007 34.298));
|
|
38
|
+
--color-muted-foreground: light-dark(oklch(0.556 0 0), oklch(0.708 0 0));
|
|
39
|
+
--color-accent: light-dark(oklch(0.97 0.001 106.424), oklch(0.268 0.007 34.298));
|
|
40
|
+
--color-accent-foreground: light-dark(oklch(0.371 0 0), oklch(0.985 0 0));
|
|
41
|
+
--color-destructive: light-dark(oklch(0.545 0.167 25.73), oklch(0.704 0.191 22.216));
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
* Status tones, this library's addition to the shadcn set (`danger` mirrors `destructive`).
|
|
45
|
+
* Each is a trio: the solid (dots, filled chips, toasts),
|
|
46
|
+
* `-foreground` for text on the page canvas (>= 4.5:1 there — amber-600
|
|
47
|
+
* only reaches 3.19:1, hence amber-700), and `-subtle` for tinted fills.
|
|
48
|
+
*/
|
|
49
|
+
--color-success: oklch(0.627 0.194 149.214);
|
|
50
|
+
--color-success-foreground: light-dark(oklch(0.527 0.154 150.069), oklch(0.792 0.209 151.711));
|
|
51
|
+
--color-success-subtle: light-dark(
|
|
52
|
+
oklch(0.527 0.154 150.069 / 5%),
|
|
53
|
+
oklch(0.871 0.15 154.449 / 10%)
|
|
54
|
+
);
|
|
55
|
+
--color-warning: oklch(0.769 0.188 70.08);
|
|
56
|
+
--color-warning-foreground: light-dark(oklch(0.555 0.163 48.998), oklch(0.828 0.189 84.429));
|
|
57
|
+
--color-warning-subtle: light-dark(
|
|
58
|
+
oklch(0.555 0.163 48.998 / 5%),
|
|
59
|
+
oklch(0.879 0.169 91.605 / 10%)
|
|
60
|
+
);
|
|
61
|
+
--color-danger: light-dark(oklch(0.545 0.167 25.73), oklch(0.704 0.191 22.216));
|
|
62
|
+
--color-danger-foreground: light-dark(oklch(0.505 0.213 27.518), oklch(0.704 0.191 22.216));
|
|
63
|
+
--color-danger-subtle: light-dark(
|
|
64
|
+
oklch(0.505 0.213 27.518 / 5%),
|
|
65
|
+
oklch(0.808 0.114 19.571 / 10%)
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
--color-border: light-dark(oklch(0.923 0.003 48.717), oklch(1 0 0 / 8%));
|
|
69
|
+
--color-input: light-dark(oklch(0.869 0.005 56.366), oklch(1 0 0 / 14%));
|
|
70
|
+
--color-ring: light-dark(oklch(0.869 0.005 56.366), oklch(1 0 0 / 18%));
|
|
71
|
+
|
|
72
|
+
/* Categorical chart palette: five hues far enough apart to read as different series. */
|
|
73
|
+
--color-chart-1: light-dark(oklch(0.52 0.11 245), oklch(0.68 0.13 245));
|
|
74
|
+
--color-chart-2: light-dark(oklch(0.6 0.14 160), oklch(0.72 0.15 160));
|
|
75
|
+
--color-chart-3: light-dark(oklch(0.7 0.15 70), oklch(0.8 0.16 75));
|
|
76
|
+
--color-chart-4: light-dark(oklch(0.55 0.15 300), oklch(0.7 0.15 300));
|
|
77
|
+
--color-chart-5: light-dark(oklch(0.58 0.17 25), oklch(0.7 0.17 25));
|
|
78
|
+
|
|
79
|
+
/* Sidebar surface, mirrored from the shadcn set so app themes can restyle it on its own. */
|
|
80
|
+
--color-sidebar: light-dark(oklch(0.985 0.001 106.423), oklch(0.147 0.004 49.25));
|
|
81
|
+
--color-sidebar-foreground: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
82
|
+
--color-sidebar-primary: light-dark(oklch(0.205 0 0), oklch(0.97 0.001 106.424));
|
|
83
|
+
--color-sidebar-primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.205 0 0));
|
|
84
|
+
--color-sidebar-accent: light-dark(oklch(0.97 0.001 106.424), oklch(0.268 0.007 34.298));
|
|
85
|
+
--color-sidebar-accent-foreground: light-dark(oklch(0.371 0 0), oklch(0.985 0 0));
|
|
86
|
+
--color-sidebar-border: light-dark(oklch(0.923 0.003 48.717), oklch(1 0 0 / 8%));
|
|
87
|
+
--color-sidebar-ring: light-dark(oklch(0.869 0.005 56.366), oklch(1 0 0 / 18%));
|
|
88
|
+
|
|
89
|
+
--tracking-micro: -0.0125em;
|
|
90
|
+
|
|
91
|
+
/*
|
|
92
|
+
* The text of a default control: buttons, inputs, select triggers, menu items, tabs,
|
|
93
|
+
* toasts. Spelled as `text-control` so the number lives in one place.
|
|
94
|
+
*/
|
|
95
|
+
--text-control: 0.8125rem;
|
|
96
|
+
--text-control--line-height: 1.25;
|
|
97
|
+
|
|
98
|
+
/*
|
|
99
|
+
* The height of a default control: an `md` Button, a segmented Tabs track, and the
|
|
100
|
+
* skeletons that stand in for either. Spelled as `h-control` / `min-h-control` so the
|
|
101
|
+
* number lives in one place.
|
|
102
|
+
*/
|
|
103
|
+
--spacing-control: 34px;
|
|
104
|
+
|
|
105
|
+
--font-sans: "Inter Variable", var(--system-font);
|
|
106
|
+
--font-display: "Inter Variable", var(--system-font);
|
|
107
|
+
--font-mono: monospace;
|
|
108
|
+
|
|
109
|
+
/* The one motion curve: popups, tab pills, number spins, chart draws, step bars. */
|
|
110
|
+
--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
|
|
111
|
+
|
|
112
|
+
--animate-fill-bar: fill-bar 0.5s var(--ease-out-expo);
|
|
113
|
+
|
|
114
|
+
@keyframes fill-bar {
|
|
115
|
+
from {
|
|
116
|
+
transform: scaleX(0);
|
|
117
|
+
}
|
|
118
|
+
to {
|
|
119
|
+
transform: scaleX(1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/*
|
|
125
|
+
* Base helpers the components depend on to render correctly. Kept minimal on purpose; the
|
|
126
|
+
* consuming app still supplies the global reset, fonts, and `@import "tailwindcss"`.
|
|
127
|
+
*/
|
|
128
|
+
@layer base {
|
|
129
|
+
/* Theme switch: unset follows the OS, `data-theme` forces one. Drives every `light-dark()`. */
|
|
130
|
+
:root {
|
|
131
|
+
color-scheme: light dark;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
[data-theme="light"] {
|
|
135
|
+
color-scheme: light;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
[data-theme="dark"] {
|
|
139
|
+
color-scheme: dark;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Tailwind v4 defaults `border` to currentColor; the components expect the hairline token. */
|
|
143
|
+
*,
|
|
144
|
+
::before,
|
|
145
|
+
::after {
|
|
146
|
+
border-color: var(--color-border);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Dashed background used by the Dialog backdrop and the dashed empty state. */
|
|
150
|
+
.bg-dashed {
|
|
151
|
+
background-image: linear-gradient(
|
|
152
|
+
45deg,
|
|
153
|
+
var(--color-border) 12.5%,
|
|
154
|
+
transparent 12.5%,
|
|
155
|
+
transparent 50%,
|
|
156
|
+
var(--color-border) 50%,
|
|
157
|
+
var(--color-border) 62.5%,
|
|
158
|
+
transparent 62.5%,
|
|
159
|
+
transparent 100%
|
|
160
|
+
);
|
|
161
|
+
background-color: color-mix(in oklch, var(--color-foreground), transparent 90%);
|
|
162
|
+
background-size: 0.25rem 0.25rem;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Default every icon to 1em unless the call site sets an explicit size. */
|
|
167
|
+
svg[aria-label*="Icon"]:not([class*="size-"]):not([class*="h-"]) {
|
|
168
|
+
@apply size-[1em]!;
|
|
169
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dirstack/ui",
|
|
3
|
+
"description": "A shared React component library",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"components",
|
|
6
|
+
"design-system",
|
|
7
|
+
"react",
|
|
8
|
+
"tailwind",
|
|
9
|
+
"ui"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/dirstack/ui#readme",
|
|
12
|
+
"bugs": "https://github.com/dirstack/ui/issues",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": {
|
|
15
|
+
"name": "Piotr Kulpinski",
|
|
16
|
+
"email": "piotr@kulpinski.pl",
|
|
17
|
+
"url": "https://kulpinski.pl"
|
|
18
|
+
},
|
|
19
|
+
"repository": "git+https://github.com/dirstack/ui.git",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"exports": {
|
|
26
|
+
"./styles.css": "./dist/styles.css",
|
|
27
|
+
"./variants": {
|
|
28
|
+
"types": "./dist/lib/variants.d.ts",
|
|
29
|
+
"default": "./dist/lib/variants.js"
|
|
30
|
+
},
|
|
31
|
+
"./classes": {
|
|
32
|
+
"types": "./dist/lib/classes.d.ts",
|
|
33
|
+
"default": "./dist/lib/classes.js"
|
|
34
|
+
},
|
|
35
|
+
"./interactive": {
|
|
36
|
+
"types": "./dist/lib/interactive.d.ts",
|
|
37
|
+
"default": "./dist/lib/interactive.js"
|
|
38
|
+
},
|
|
39
|
+
"./slot": {
|
|
40
|
+
"types": "./dist/lib/slot.d.ts",
|
|
41
|
+
"default": "./dist/lib/slot.js"
|
|
42
|
+
},
|
|
43
|
+
"./*": {
|
|
44
|
+
"types": "./dist/components/*.d.ts",
|
|
45
|
+
"default": "./dist/components/*.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"clean": "rimraf ./dist",
|
|
53
|
+
"prebuild": "bun run clean",
|
|
54
|
+
"build": "tsdown",
|
|
55
|
+
"dev": "tsdown --watch",
|
|
56
|
+
"sandbox": "cosmos",
|
|
57
|
+
"sandbox:build": "cosmos-export",
|
|
58
|
+
"test": "bun test",
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
|
+
"lint": "oxlint --fix .",
|
|
61
|
+
"format": "oxfmt --write .",
|
|
62
|
+
"prepare": "lefthook install"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@hugeicons/core-free-icons": "^4.3.0",
|
|
66
|
+
"@hugeicons/react": "^1.1.10",
|
|
67
|
+
"@number-flow/react": "^0.6.1",
|
|
68
|
+
"cn": "^0.2.4",
|
|
69
|
+
"recharts": "^3.9.2",
|
|
70
|
+
"sonner": "^2.0.8",
|
|
71
|
+
"tailwind-variants": "^3.2.2"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@base-ui/react": "^1.7.0",
|
|
75
|
+
"@commitlint/cli": "^20.4.2",
|
|
76
|
+
"@commitlint/config-conventional": "^20.4.2",
|
|
77
|
+
"@dirstack/kodeks": "1.1.2",
|
|
78
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
79
|
+
"@types/bun": "^1.2.21",
|
|
80
|
+
"@types/react": "^19.2.17",
|
|
81
|
+
"@types/react-dom": "^19.2.3",
|
|
82
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
83
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
84
|
+
"lefthook": "^2.1.1",
|
|
85
|
+
"oxfmt": "^0.44.0",
|
|
86
|
+
"oxlint": "^1.59.0",
|
|
87
|
+
"react": "^19.2.7",
|
|
88
|
+
"react-cosmos": "^7.4.1",
|
|
89
|
+
"react-cosmos-plugin-vite": "^7.4.0",
|
|
90
|
+
"react-dom": "^19.2.7",
|
|
91
|
+
"react-hook-form": "^7.87.0",
|
|
92
|
+
"rimraf": "^6.0.1",
|
|
93
|
+
"semantic-release": "^25.0.3",
|
|
94
|
+
"tailwindcss": "^4.1.0",
|
|
95
|
+
"tailwindcss-animate": "^1.0.7",
|
|
96
|
+
"tsdown": "^0.23.0",
|
|
97
|
+
"typescript": "^5.9.3",
|
|
98
|
+
"vite": "^7.3.6"
|
|
99
|
+
},
|
|
100
|
+
"peerDependencies": {
|
|
101
|
+
"@base-ui/react": ">=1",
|
|
102
|
+
"react": ">=19",
|
|
103
|
+
"react-dom": ">=19",
|
|
104
|
+
"react-hook-form": ">=7",
|
|
105
|
+
"tailwindcss": ">=4",
|
|
106
|
+
"tailwindcss-animate": ">=1"
|
|
107
|
+
},
|
|
108
|
+
"engines": {
|
|
109
|
+
"node": ">=18"
|
|
110
|
+
},
|
|
111
|
+
"version": "1.0.0"
|
|
112
|
+
}
|