@jbpark/ui-kit 5.4.6 → 5.4.7
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/Button.d.mts +8 -7
- package/dist/Button.d.mts.map +1 -1
- package/dist/Button.mjs +17 -11
- package/dist/Button.mjs.map +1 -1
- package/dist/Tag.d.mts +6 -5
- package/dist/Tag.d.mts.map +1 -1
- package/dist/Tag.mjs +8 -6
- package/dist/Tag.mjs.map +1 -1
- package/dist/components/atoms/checkbox/checkbox.mjs +1 -1
- package/dist/components/atoms/date-picker.mjs +2 -2
- package/dist/components/atoms/float-button/back-top.mjs +1 -1
- package/dist/components/atoms/input/search.mjs +2 -2
- package/dist/components/atoms/radio/group.mjs +1 -1
- package/dist/components/atoms/radio/radio.mjs +1 -1
- package/dist/components/molecules/menu/item/item.mjs +1 -1
- package/dist/components/molecules/upload.mjs +1 -1
- package/dist/components/organisms/drawer.mjs +2 -2
- package/dist/components/organisms/modal.mjs +2 -2
- package/dist/components/organisms/toast.mjs +1 -1
- package/dist/components/templates/container.mjs +1 -1
- package/dist/components/templates/layout/content.mjs +1 -1
- package/dist/components/templates/layout/sider.mjs +1 -1
- package/dist/core/accordion.mjs +2 -2
- package/dist/core/badge.d.mts +1 -1
- package/dist/core/badge.mjs +1 -1
- package/dist/core/button.d.mts +1 -1
- package/dist/core/button.mjs +1 -1
- package/dist/core/calendar.mjs +1 -1
- package/dist/core/checkbox.mjs +1 -1
- package/dist/core/dialog.mjs +1 -1
- package/dist/core/radio-group.mjs +1 -1
- package/dist/core/select.mjs +1 -1
- package/dist/lib/chassis.mjs +23 -0
- package/dist/lib/chassis.mjs.map +1 -0
- package/dist/providers/config/config.mjs +1 -1
- package/package.json +5 -1
package/dist/Button.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./core.mjs";
|
|
1
|
+
import * as React$1 from "react";
|
|
3
2
|
//#region src/components/atoms/button.d.ts
|
|
4
|
-
type
|
|
3
|
+
type NativeButtonProps = React$1.ComponentProps<'button'> & {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
};
|
|
5
6
|
type PresetColors = 'blue' | 'purple' | 'cyan' | 'green' | 'magenta' | 'pink' | 'red' | 'orange' | 'yellow' | 'volcano' | 'geekblue' | 'lime' | 'gold';
|
|
6
|
-
interface Props extends Omit<
|
|
7
|
-
icon?: React.ReactNode;
|
|
7
|
+
interface Props extends Omit<NativeButtonProps, 'size' | 'variant' | 'type'> {
|
|
8
|
+
icon?: React$1.ReactNode;
|
|
8
9
|
block?: boolean;
|
|
9
10
|
danger?: boolean;
|
|
10
11
|
disabled?: boolean;
|
|
@@ -25,10 +26,10 @@ interface Props extends Omit<ButtonProps, 'size' | 'variant' | 'type'> {
|
|
|
25
26
|
shape?: 'default' | 'circle' | 'round';
|
|
26
27
|
color?: PresetColors | 'default' | 'primary' | 'danger';
|
|
27
28
|
loading?: boolean | {
|
|
28
|
-
icon: React.ReactNode;
|
|
29
|
+
icon: React$1.ReactNode;
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
|
-
declare const Button: ({ icon, className, type, variant, htmlType, size, color, shape, block, disabled, loading, danger, children, onMouseDown, ...props }: Props) =>
|
|
32
|
+
declare const Button: ({ icon, className, type, variant, htmlType, size, color, shape, block, disabled, loading, danger, asChild, children, onMouseDown, ...props }: Props) => React$1.JSX.Element;
|
|
32
33
|
//#endregion
|
|
33
34
|
export { Props, Button as default };
|
|
34
35
|
//# sourceMappingURL=Button.d.mts.map
|
package/dist/Button.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.mts","names":[],"sources":["../src/components/atoms/button.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.mts","names":[],"sources":["../src/components/atoms/button.tsx"],"mappings":";;KAYK,oBAAoB,QAAM;EAC7B;;KAGG;UAeY,cAAc,KAC7B;EAGA,OAAO,QAAM;EACb;EACA;EACA;EACA;;;;;;EAMA;EACA;;;;;;EAMA;EACA;EACA,QAAQ;EACR;IAAsB,MAAM,QAAM;;;cA2E9B,WAAU,MAAA,WAAA,MAAA,SAAA,UAAA,MAAA,OAAA,OAAA,OAAA,UAAA,SAAA,QAAA,SAAA,UAAA,gBAAA,SAiBb,UAAK,QAAA,IAAA"}
|
package/dist/Button.mjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "./utils.mjs";
|
|
3
|
-
import { Button as Button$1 } from "./core/button.mjs";
|
|
4
3
|
import { useConfig } from "./providers/config/context.mjs";
|
|
4
|
+
import { INTERACTIVE_CHASSIS } from "./lib/chassis.mjs";
|
|
5
|
+
import "react";
|
|
6
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
5
7
|
import { LoaderCircle } from "lucide-react";
|
|
6
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
9
|
//#region src/components/atoms/button.tsx
|
|
8
|
-
const
|
|
10
|
+
const BUTTON_CHASSIS = cn(INTERACTIVE_CHASSIS, "outline-none", "disabled:pointer-events-none disabled:opacity-50", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4");
|
|
11
|
+
const BUTTON_BASE = cn(BUTTON_CHASSIS, "gap-2 whitespace-nowrap font-medium transition-all", "has-[>svg]:px-3");
|
|
9
12
|
const variantClasses = {
|
|
10
|
-
solid: "",
|
|
13
|
+
solid: cn("bg-primary text-primary-foreground", "hover:bg-primary/90"),
|
|
11
14
|
outlined: cn("border border-[color-mix(in_oklch,var(--btn-border),transparent_50%)]", "bg-background text-foreground", "hover:bg-accent"),
|
|
12
15
|
dashed: cn("border border-dashed border-[color-mix(in_oklch,var(--btn-border),transparent_50%)]", "bg-background text-foreground", "hover:bg-accent"),
|
|
13
16
|
filled: cn("bg-muted text-foreground", "hover:bg-muted/80"),
|
|
@@ -36,7 +39,7 @@ const shapesClasses = {
|
|
|
36
39
|
circle: "rounded-full",
|
|
37
40
|
round: "rounded-2xl"
|
|
38
41
|
};
|
|
39
|
-
const Button = ({ icon, className, type = "default", variant, htmlType = "button", size, color = "default", shape, block = false, disabled, loading, danger, children, onMouseDown, ...props }) => {
|
|
42
|
+
const Button = ({ icon, className, type = "default", variant, htmlType = "button", size, color = "default", shape, block = false, disabled, loading, danger, asChild = false, children, onMouseDown, ...props }) => {
|
|
40
43
|
const { componentSize, defaultProps } = useConfig();
|
|
41
44
|
const buttonDefaults = defaultProps?.button;
|
|
42
45
|
const resolvedSize = size ?? componentSize ?? "middle";
|
|
@@ -46,20 +49,23 @@ const Button = ({ icon, className, type = "default", variant, htmlType = "button
|
|
|
46
49
|
const colored = computedColor && computedColor !== "default";
|
|
47
50
|
const resolvedVariant = variant ?? typeToVariant[type] ?? "solid";
|
|
48
51
|
const isLoading = !!loading;
|
|
52
|
+
const Comp = asChild ? Slot : "button";
|
|
49
53
|
const displayIcon = loading ? typeof loading === "object" ? loading.icon : /* @__PURE__ */ jsx(LoaderCircle, { className: "animate-spin" }) : icon;
|
|
50
|
-
return /* @__PURE__ */ jsxs(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
"data-color": computedColor,
|
|
56
|
-
className: cn("inline-flex items-center justify-center gap-x-2", "rounded-lg", "cursor-pointer", "h-auto py-0", "transition-all", variantClasses[resolvedVariant], sizesClasses[resolvedSize], iconOnly && ["p-0", iconClasses[resolvedSize]], shapesClasses[resolvedShape], block && "w-full", colored && (resolvedVariant === "solid" ? [
|
|
54
|
+
return /* @__PURE__ */ jsxs(Comp, {
|
|
55
|
+
"data-slot": "button",
|
|
56
|
+
"data-variant": "default",
|
|
57
|
+
"data-size": "default",
|
|
58
|
+
className: cn(BUTTON_BASE, "inline-flex items-center justify-center gap-x-2", "rounded-lg", "cursor-pointer", "h-auto py-0", "transition-all", variantClasses[resolvedVariant], sizesClasses[resolvedSize], iconOnly && ["p-0", iconClasses[resolvedSize]], shapesClasses[resolvedShape], block && "w-full", colored && (resolvedVariant === "solid" ? [
|
|
57
59
|
"bg-(--btn-bg)",
|
|
58
60
|
"hover:bg-(--btn-bg-hover)",
|
|
59
61
|
"active:bg-(--btn-bg-active)",
|
|
60
62
|
"text-(--btn-fg)",
|
|
61
63
|
"border-(--btn-border)"
|
|
62
64
|
] : ["text-(--btn-bg)", "border-[color-mix(in_oklch,var(--btn-border),transparent_50%)]"]), className),
|
|
65
|
+
type: htmlType,
|
|
66
|
+
disabled: disabled || isLoading,
|
|
67
|
+
"aria-busy": isLoading,
|
|
68
|
+
"data-color": computedColor,
|
|
63
69
|
onMouseDown: (e) => {
|
|
64
70
|
onMouseDown?.(e);
|
|
65
71
|
},
|
package/dist/Button.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.mjs","names":[
|
|
1
|
+
{"version":3,"file":"Button.mjs","names":[],"sources":["../src/components/atoms/button.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport { LoaderCircle } from 'lucide-react';\n\nimport { useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport { INTERACTIVE_CHASSIS } from '../../lib/chassis';\n\ntype NativeButtonProps = React.ComponentProps<'button'> & {\n asChild?: boolean;\n};\n\ntype PresetColors =\n | 'blue'\n | 'purple'\n | 'cyan'\n | 'green'\n | 'magenta'\n | 'pink'\n | 'red'\n | 'orange'\n | 'yellow'\n | 'volcano'\n | 'geekblue'\n | 'lime'\n | 'gold';\n\nexport interface Props extends Omit<\n NativeButtonProps,\n 'size' | 'variant' | 'type'\n> {\n icon?: React.ReactNode;\n block?: boolean;\n danger?: boolean;\n disabled?: boolean;\n size?: 'small' | 'middle' | 'large';\n /**\n * antd-style visual preset. Maps to a `variant` internally — passing\n * both `type` and `variant` lets `variant` win, so it can override the\n * preset for one-off cases without needing every value duplicated here.\n */\n type?: 'primary' | 'default' | 'dashed' | 'text' | 'link';\n variant?: 'solid' | 'outlined' | 'dashed' | 'filled' | 'text' | 'link';\n /**\n * Native `<button>` `type` (`button`/`submit`/`reset`), kept separate\n * from the antd-style `type` above. Defaults to `'button'` so a Button\n * placed inside a `<form>` doesn't submit it unless explicitly opted in.\n */\n htmlType?: 'button' | 'submit' | 'reset';\n shape?: 'default' | 'circle' | 'round';\n color?: PresetColors | 'default' | 'primary' | 'danger';\n loading?: boolean | { icon: React.ReactNode };\n}\n\n// Chassis absorbed from core/button's cva base (#278 ③ / #294 Phase 4). The\n// shared focus/aria set lives in INTERACTIVE_CHASSIS; a Button additionally\n// disables and sizes its icons. Kept as constants so the absorb relocates this\n// treatment rather than dropping it (the #177 class of silent regression the\n// #300/#301 net guards).\nconst BUTTON_CHASSIS = cn(\n INTERACTIVE_CHASSIS,\n 'outline-none',\n 'disabled:pointer-events-none disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n);\n\n// Presentation the atom builds on. The size/variant/shape classes below still\n// override the incidental leftovers exactly as they did when this wrapped\n// core/button, so the rendered output is unchanged (verified against a\n// pre-refactor render matrix).\nconst BUTTON_BASE = cn(\n BUTTON_CHASSIS,\n 'gap-2 whitespace-nowrap font-medium transition-all',\n 'has-[>svg]:px-3',\n);\n\nconst variantClasses: Record<string, string> = {\n // solid used to inherit its fill from core/button's default variant; carry it\n // explicitly now that the primitive is absorbed. A colored solid overrides\n // this with the --btn-* custom properties further down.\n solid: cn('bg-primary text-primary-foreground', 'hover:bg-primary/90'),\n outlined: cn(\n 'border border-[color-mix(in_oklch,var(--btn-border),transparent_50%)]',\n 'bg-background text-foreground',\n 'hover:bg-accent',\n ),\n dashed: cn(\n 'border border-dashed border-[color-mix(in_oklch,var(--btn-border),transparent_50%)]',\n 'bg-background text-foreground',\n 'hover:bg-accent',\n ),\n filled: cn('bg-muted text-foreground', 'hover:bg-muted/80'),\n text: cn('bg-transparent text-foreground', 'hover:bg-accent'),\n link: cn(\n 'bg-transparent text-primary',\n 'underline-offset-4 hover:underline',\n 'hover:bg-primary/10',\n ),\n};\n\nconst typeToVariant: Record<string, string> = {\n primary: 'solid',\n default: 'outlined',\n dashed: 'dashed',\n text: 'text',\n link: 'link',\n};\n\nconst sizesClasses: Record<string, string> = {\n small: 'h-6 px-3 text-sm',\n middle: 'h-8 px-4 text-base',\n large: 'h-10 px-5 text-lg',\n};\n\nconst iconClasses: Record<string, string> = {\n small: `size-6 [&_svg:not([class*='size-'])]:size-3`,\n middle: `size-8 [&_svg:not([class*='size-'])]:size-4`,\n large: `size-10 [&_svg:not([class*='size-'])]:size-5`,\n};\n\nconst shapesClasses = {\n default: 'rounded-sm',\n circle: 'rounded-full',\n round: 'rounded-2xl',\n};\n\nconst Button = ({\n icon,\n className,\n type = 'default',\n variant,\n htmlType = 'button',\n size,\n color = 'default',\n shape,\n block = false,\n disabled,\n loading,\n danger,\n asChild = false,\n children,\n onMouseDown,\n ...props\n}: Props) => {\n const { componentSize, defaultProps } = useConfig();\n const buttonDefaults = defaultProps?.button as\n Partial<Pick<Props, 'shape'>> | undefined;\n const resolvedSize = size ?? componentSize ?? 'middle';\n const resolvedShape = shape ?? buttonDefaults?.shape ?? 'default';\n const iconOnly = icon && !children;\n const computedColor = danger ? 'danger' : color;\n const colored = computedColor && computedColor !== 'default';\n const resolvedVariant = variant ?? typeToVariant[type] ?? 'solid';\n const isLoading = !!loading;\n\n const Comp = asChild ? Slot : 'button';\n\n const displayIcon = loading ? (\n typeof loading === 'object' ? (\n loading.icon\n ) : (\n <LoaderCircle className=\"animate-spin\" />\n )\n ) : (\n icon\n );\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant=\"default\"\n data-size=\"default\"\n className={cn(\n BUTTON_BASE,\n 'inline-flex items-center justify-center gap-x-2',\n 'rounded-lg',\n 'cursor-pointer',\n 'h-auto py-0',\n 'transition-all',\n variantClasses[resolvedVariant],\n sizesClasses[resolvedSize],\n iconOnly && ['p-0', iconClasses[resolvedSize]],\n shapesClasses[resolvedShape],\n block && 'w-full',\n colored &&\n (resolvedVariant === 'solid'\n ? [\n 'bg-(--btn-bg)',\n 'hover:bg-(--btn-bg-hover)',\n 'active:bg-(--btn-bg-active)',\n 'text-(--btn-fg)',\n 'border-(--btn-border)',\n ]\n : [\n 'text-(--btn-bg)',\n 'border-[color-mix(in_oklch,var(--btn-border),transparent_50%)]',\n //\n ]),\n className,\n //\n )}\n type={htmlType}\n disabled={disabled || isLoading}\n aria-busy={isLoading}\n data-color={computedColor}\n onMouseDown={e => {\n onMouseDown?.(e);\n }}\n {...props}\n >\n {displayIcon}\n {children}\n </Comp>\n );\n};\n\nexport default Button;\n"],"mappings":";;;;;;;;;AA+DA,MAAM,iBAAiB,GACrB,qBACA,gBACA,oDACA,mFACF;AAMA,MAAM,cAAc,GAClB,gBACA,sDACA,iBACF;AAEA,MAAM,iBAAyC;CAI7C,OAAO,GAAG,sCAAsC,qBAAqB;CACrE,UAAU,GACR,yEACA,iCACA,iBACF;CACA,QAAQ,GACN,uFACA,iCACA,iBACF;CACA,QAAQ,GAAG,4BAA4B,mBAAmB;CAC1D,MAAM,GAAG,kCAAkC,iBAAiB;CAC5D,MAAM,GACJ,+BACA,sCACA,qBACF;AACF;AAEA,MAAM,gBAAwC;CAC5C,SAAS;CACT,SAAS;CACT,QAAQ;CACR,MAAM;CACN,MAAM;AACR;AAEA,MAAM,eAAuC;CAC3C,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AAEA,MAAM,cAAsC;CAC1C,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AAEA,MAAM,gBAAgB;CACpB,SAAS;CACT,QAAQ;CACR,OAAO;AACT;AAEA,MAAM,UAAU,EACd,MACA,WACA,OAAO,WACP,SACA,WAAW,UACX,MACA,QAAQ,WACR,OACA,QAAQ,OACR,UACA,SACA,QACA,UAAU,OACV,UACA,aACA,GAAG,YACQ;CACX,MAAM,EAAE,eAAe,iBAAiB,UAAU;CAClD,MAAM,iBAAiB,cAAc;CAErC,MAAM,eAAe,QAAQ,iBAAiB;CAC9C,MAAM,gBAAgB,SAAS,gBAAgB,SAAS;CACxD,MAAM,WAAW,QAAQ,CAAC;CAC1B,MAAM,gBAAgB,SAAS,WAAW;CAC1C,MAAM,UAAU,iBAAiB,kBAAkB;CACnD,MAAM,kBAAkB,WAAW,cAAc,SAAS;CAC1D,MAAM,YAAY,CAAC,CAAC;CAEpB,MAAM,OAAO,UAAU,OAAO;CAE9B,MAAM,cAAc,UAClB,OAAO,YAAY,WACjB,QAAQ,OAER,oBAAC,cAAD,EAAc,WAAU,eAAgB,CAAA,IAG1C;CAGF,OACE,qBAAC,MAAD;EACE,aAAU;EACV,gBAAa;EACb,aAAU;EACV,WAAW,GACT,aACA,mDACA,cACA,kBACA,eACA,kBACA,eAAe,kBACf,aAAa,eACb,YAAY,CAAC,OAAO,YAAY,aAAa,GAC7C,cAAc,gBACd,SAAS,UACT,YACG,oBAAoB,UACjB;GACE;GACA;GACA;GACA;GACA;EACF,IACA,CACE,mBACA,gEAEF,IACN,SAEF;EACA,MAAM;EACN,UAAU,YAAY;EACtB,aAAW;EACX,cAAY;EACZ,cAAa,MAAK;GAChB,cAAc,CAAC;EACjB;EACA,GAAI;EAxCN,UAAA,CA0CG,aACA,QACG;;AAEV"}
|
package/dist/Tag.d.mts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./core.mjs";
|
|
1
|
+
import * as React$1 from "react";
|
|
3
2
|
//#region src/components/atoms/tag.d.ts
|
|
4
|
-
type
|
|
5
|
-
|
|
3
|
+
type NativeSpanProps = React$1.ComponentProps<'span'> & {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
};
|
|
6
|
+
interface Props extends Omit<NativeSpanProps, 'variant'> {
|
|
6
7
|
variant?: 'default' | 'outlined';
|
|
7
8
|
color?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
|
|
8
9
|
}
|
|
9
|
-
declare const Tag: ({ className, variant, color, children, ...props }: Props) =>
|
|
10
|
+
declare const Tag: ({ className, variant, color, asChild, children, ...props }: Props) => React$1.JSX.Element;
|
|
10
11
|
//#endregion
|
|
11
12
|
export { Props, Tag as default };
|
|
12
13
|
//# sourceMappingURL=Tag.d.mts.map
|
package/dist/Tag.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.mts","names":[],"sources":["../src/components/atoms/tag.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tag.d.mts","names":[],"sources":["../src/components/atoms/tag.tsx"],"mappings":";;KAQK,kBAAkB,QAAM;EAC3B;;UAGe,cAAc,KAAK;EAClC;EACA;;cAoCI,QAAO,WAAA,SAAA,OAAA,SAAA,aAAA,SAOV,UAAK,QAAA,IAAA"}
|
package/dist/Tag.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { cn } from "./utils.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { INTERACTIVE_CHASSIS } from "./lib/chassis.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
5
|
import { jsx } from "react/jsx-runtime";
|
|
4
6
|
//#region src/components/atoms/tag.tsx
|
|
5
|
-
const
|
|
7
|
+
const TAG_BASE = cn(INTERACTIVE_CHASSIS, "border w-fit whitespace-nowrap overflow-hidden", "text-xs font-medium gap-1 transition-[color,box-shadow]", "[&>svg]:size-3 [&>svg]:pointer-events-none", "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground");
|
|
6
8
|
const fillColorClasses = {
|
|
7
9
|
default: "border-transparent bg-muted text-muted-foreground",
|
|
8
10
|
primary: "border-transparent bg-primary/10 text-primary",
|
|
@@ -17,10 +19,10 @@ const outlinedColorClasses = {
|
|
|
17
19
|
warning: "border-yellow-500 text-yellow-600 dark:text-yellow-400",
|
|
18
20
|
danger: "border-destructive text-destructive"
|
|
19
21
|
};
|
|
20
|
-
const Tag = ({ className, variant = "default", color = "default", children, ...props }) => {
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
-
|
|
23
|
-
className: cn("rounded-full px-2.5 py-1", "text-xs font-medium", variant === "default" && fillColorClasses[color], variant === "outlined" && outlinedColorClasses[color], className),
|
|
22
|
+
const Tag = ({ className, variant = "default", color = "default", asChild = false, children, ...props }) => {
|
|
23
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "span", {
|
|
24
|
+
"data-slot": "badge",
|
|
25
|
+
className: cn(TAG_BASE, "rounded-full px-2.5 py-1", "text-xs font-medium", variant === "default" && fillColorClasses[color], variant === "outlined" && outlinedColorClasses[color], className),
|
|
24
26
|
...props,
|
|
25
27
|
children
|
|
26
28
|
});
|
package/dist/Tag.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.mjs","names":[
|
|
1
|
+
{"version":3,"file":"Tag.mjs","names":[],"sources":["../src/components/atoms/tag.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '@repo/ui/utils';\n\nimport { INTERACTIVE_CHASSIS } from '../../lib/chassis';\n\ntype NativeSpanProps = React.ComponentProps<'span'> & {\n asChild?: boolean;\n};\n\nexport interface Props extends Omit<NativeSpanProps, 'variant'> {\n variant?: 'default' | 'outlined';\n color?: 'default' | 'primary' | 'success' | 'warning' | 'danger';\n}\n\n// Base absorbed from core/badge's cva base + its `outline` variant, which Tag\n// always rendered as (#278 ③ / #294 Phase 4). The shared focus/aria/centering\n// set lives in INTERACTIVE_CHASSIS; a Tag adds badge geometry and its svg\n// sizing but — unlike Button — no `disabled:*` (a Tag is not disableable). The\n// rounded/padding leftovers are overridden by the atom classes below exactly as\n// before, so the rendered output is unchanged (verified against a pre-refactor\n// render matrix).\nconst TAG_BASE = cn(\n INTERACTIVE_CHASSIS,\n 'border w-fit whitespace-nowrap overflow-hidden',\n 'text-xs font-medium gap-1 transition-[color,box-shadow]',\n '[&>svg]:size-3 [&>svg]:pointer-events-none',\n 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n);\n\nconst fillColorClasses: Record<string, string> = {\n default: 'border-transparent bg-muted text-muted-foreground',\n primary: 'border-transparent bg-primary/10 text-primary',\n success:\n 'border-transparent bg-green-500/10 text-green-600 dark:text-green-400',\n warning:\n 'border-transparent bg-yellow-500/10 text-yellow-600 dark:text-yellow-400',\n danger: 'border-transparent bg-destructive/10 text-destructive',\n};\n\nconst outlinedColorClasses: Record<string, string> = {\n default: 'border-border text-foreground',\n primary: 'border-primary text-primary',\n success: 'border-green-500 text-green-600 dark:text-green-400',\n warning: 'border-yellow-500 text-yellow-600 dark:text-yellow-400',\n danger: 'border-destructive text-destructive',\n};\n\nconst Tag = ({\n className,\n variant = 'default',\n color = 'default',\n asChild = false,\n children,\n ...props\n}: Props) => {\n const Comp = asChild ? Slot : 'span';\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(\n TAG_BASE,\n 'rounded-full px-2.5 py-1',\n 'text-xs font-medium',\n variant === 'default' && fillColorClasses[color],\n variant === 'outlined' && outlinedColorClasses[color],\n className,\n //\n )}\n {...props}\n >\n {children}\n </Comp>\n );\n};\n\nexport default Tag;\n"],"mappings":";;;;;;AAwBA,MAAM,WAAW,GACf,qBACA,kDACA,2DACA,8CACA,wEACF;AAEA,MAAM,mBAA2C;CAC/C,SAAS;CACT,SAAS;CACT,SACE;CACF,SACE;CACF,QAAQ;AACV;AAEA,MAAM,uBAA+C;CACnD,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAEA,MAAM,OAAO,EACX,WACA,UAAU,WACV,QAAQ,WACR,UAAU,OACV,UACA,GAAG,YACQ;CAGX,OACE,oBAHW,UAAU,OAAO,QAG5B;EACE,aAAU;EACV,WAAW,GACT,UACA,4BACA,uBACA,YAAY,aAAa,iBAAiB,QAC1C,YAAY,cAAc,qBAAqB,QAC/C,SAEF;EACA,GAAI;EAEH;CACG,CAAA;AAEV"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { cn } from "../../../utils.mjs";
|
|
3
3
|
import { checkbox_exports } from "../../../core/checkbox.mjs";
|
|
4
4
|
import { label_exports } from "../../../core/label.mjs";
|
|
5
|
-
import { Square, SquareCheck } from "lucide-react";
|
|
6
5
|
import { useId, useRef } from "react";
|
|
6
|
+
import { Square, SquareCheck } from "lucide-react";
|
|
7
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useControllableState, useKeyPress } from "@jbpark/use-hooks";
|
|
9
9
|
//#region src/components/atoms/checkbox/checkbox.tsx
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils.mjs";
|
|
3
|
-
import { calendar_exports } from "../../core/calendar.mjs";
|
|
4
3
|
import Button from "../../Button.mjs";
|
|
4
|
+
import { calendar_exports } from "../../core/calendar.mjs";
|
|
5
5
|
import Popover from "./popover.mjs";
|
|
6
|
-
import { CalendarIcon } from "lucide-react";
|
|
7
6
|
import { useState } from "react";
|
|
7
|
+
import { CalendarIcon } from "lucide-react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { useControllableState } from "@jbpark/use-hooks";
|
|
10
10
|
import { format } from "date-fns";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { cn } from "../../../utils.mjs";
|
|
3
3
|
import { DEFAULT_LOCALE, useConfig } from "../../../providers/config/context.mjs";
|
|
4
4
|
import FloatButton from "./float-button.mjs";
|
|
5
|
-
import { ArrowUp } from "lucide-react";
|
|
6
5
|
import { useRef } from "react";
|
|
6
|
+
import { ArrowUp } from "lucide-react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { useMergedRef, useWindowScroll } from "@jbpark/use-hooks";
|
|
9
9
|
//#region src/components/atoms/float-button/back-top.tsx
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../utils.mjs";
|
|
3
3
|
import { DEFAULT_LOCALE, useConfig } from "../../../providers/config/context.mjs";
|
|
4
|
-
import { input_exports } from "../../../core/input.mjs";
|
|
5
4
|
import Button from "../../../Button.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { input_exports } from "../../../core/input.mjs";
|
|
7
6
|
import { useRef, useState } from "react";
|
|
7
|
+
import { CircleX, Search } from "lucide-react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useMergedRef } from "@jbpark/use-hooks";
|
|
10
10
|
//#region src/components/atoms/input/search.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../utils.mjs";
|
|
3
|
-
import { radio_group_exports } from "../../../core/radio-group.mjs";
|
|
4
3
|
import Button from "../../../Button.mjs";
|
|
4
|
+
import { radio_group_exports } from "../../../core/radio-group.mjs";
|
|
5
5
|
import { normalizeOptions, warnOnDuplicateOptionValues } from "../option-group.mjs";
|
|
6
6
|
import { RadioGroupContext } from "./context.mjs";
|
|
7
7
|
import Radio from "./radio.mjs";
|
|
@@ -3,8 +3,8 @@ import { cn } from "../../../utils.mjs";
|
|
|
3
3
|
import { field_exports } from "../../../core/field.mjs";
|
|
4
4
|
import { radio_group_exports } from "../../../core/radio-group.mjs";
|
|
5
5
|
import { RadioGroupContext } from "./context.mjs";
|
|
6
|
-
import { Circle, CircleCheck } from "lucide-react";
|
|
7
6
|
import { useContext, useId, useRef } from "react";
|
|
7
|
+
import { Circle, CircleCheck } from "lucide-react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useControllableState, useKeyPress } from "@jbpark/use-hooks";
|
|
10
10
|
//#region src/components/atoms/radio/radio.tsx
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { cn } from "../../../../utils.mjs";
|
|
3
3
|
import Label from "./label.mjs";
|
|
4
4
|
import { MENU_CLASSNAMES } from "../menu.mjs";
|
|
5
|
-
import { ChevronDown } from "lucide-react";
|
|
6
5
|
import { createElement, useRef, useState } from "react";
|
|
6
|
+
import { ChevronDown } from "lucide-react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { AnimatePresence, motion } from "motion/react";
|
|
9
9
|
//#region src/components/molecules/menu/item/item.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils.mjs";
|
|
3
3
|
import Button from "../../Button.mjs";
|
|
4
|
-
import { Upload, X } from "lucide-react";
|
|
5
4
|
import { useId } from "react";
|
|
5
|
+
import { Upload, X } from "lucide-react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useControllableState, useFileDrop, useFileToDataUrl } from "@jbpark/use-hooks";
|
|
8
8
|
//#region src/components/molecules/upload.tsx
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn, renderConditional } from "../../utils.mjs";
|
|
3
3
|
import { DEFAULT_LOCALE, useConfig } from "../../providers/config/context.mjs";
|
|
4
|
-
import { drawer_exports } from "../../core/drawer.mjs";
|
|
5
4
|
import Button from "../../Button.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { drawer_exports } from "../../core/drawer.mjs";
|
|
7
6
|
import { useEffect } from "react";
|
|
7
|
+
import { X } from "lucide-react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/organisms/drawer.tsx
|
|
10
10
|
const { DrawerContent, Drawer: DrawerCore, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle } = drawer_exports;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils.mjs";
|
|
3
3
|
import { DEFAULT_LOCALE, useConfig } from "../../providers/config/context.mjs";
|
|
4
|
-
import { dialog_exports } from "../../core/dialog.mjs";
|
|
5
4
|
import Button from "../../Button.mjs";
|
|
5
|
+
import { dialog_exports } from "../../core/dialog.mjs";
|
|
6
6
|
import { createImperativeStack, isBrowser } from "./imperative-stack.mjs";
|
|
7
|
-
import { Check, CircleQuestionMark, Info, OctagonAlert, OctagonX } from "lucide-react";
|
|
8
7
|
import { useState } from "react";
|
|
8
|
+
import { Check, CircleQuestionMark, Info, OctagonAlert, OctagonX } from "lucide-react";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { createPortal } from "react-dom";
|
|
11
11
|
//#region src/components/organisms/modal.tsx
|
|
@@ -3,8 +3,8 @@ import { cn } from "../../utils.mjs";
|
|
|
3
3
|
import { DEFAULT_LOCALE, useConfig } from "../../providers/config/context.mjs";
|
|
4
4
|
import Button from "../../Button.mjs";
|
|
5
5
|
import { createImperativeStack, isBrowser } from "./imperative-stack.mjs";
|
|
6
|
-
import { Check, Info, OctagonAlert, OctagonX, X } from "lucide-react";
|
|
7
6
|
import { useState } from "react";
|
|
7
|
+
import { Check, Info, OctagonAlert, OctagonX, X } from "lucide-react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useTimeout } from "@jbpark/use-hooks";
|
|
10
10
|
import { createPortal } from "react-dom";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../utils.mjs";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/templates/container.tsx
|
|
5
5
|
const MAX_WIDTH_CLASSES = {
|
|
6
6
|
"3xs": "max-w-3xs",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils.mjs";
|
|
2
2
|
import { SiderRegistryContext } from "./sider-context.mjs";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/templates/layout/content.tsx
|
|
6
6
|
const Content = ({ children, className, asChild = false, ...props }) => {
|
|
7
7
|
return /* @__PURE__ */ jsx(asChild ? Slot : "main", {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { cn } from "../../../utils.mjs";
|
|
3
3
|
import { DEFAULT_LOCALE, useConfig } from "../../../providers/config/context.mjs";
|
|
4
4
|
import { useRegisterSider } from "./sider-context.mjs";
|
|
5
|
-
import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
6
5
|
import { useEffect, useId, useRef } from "react";
|
|
6
|
+
import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useControllableState, useResponsiveSize } from "@jbpark/use-hooks";
|
|
9
9
|
//#region src/components/templates/layout/sider.tsx
|
package/dist/core/accordion.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
|
-
import { ChevronDownIcon } from "lucide-react";
|
|
5
4
|
import "react";
|
|
6
|
-
import
|
|
5
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
8
8
|
//#region src/core/accordion.tsx
|
|
9
9
|
var accordion_exports = /* @__PURE__ */ __exportAll({
|
|
10
10
|
Accordion: () => Accordion,
|
package/dist/core/badge.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ declare namespace badge_d_exports {
|
|
|
4
4
|
export { Badge, Props, badgeVariants };
|
|
5
5
|
}
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "default" | "outline" | "secondary" | "destructive" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
type Props = React$1.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
10
10
|
asChild?: boolean;
|
package/dist/core/badge.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { cn } from "../utils.mjs";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
//#region src/core/badge.tsx
|
|
8
8
|
var badge_exports = /* @__PURE__ */ __exportAll({
|
package/dist/core/button.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ declare namespace button_d_exports {
|
|
|
4
4
|
export { Button, Props, buttonVariants };
|
|
5
5
|
}
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "link" | "
|
|
7
|
+
variant?: "link" | "default" | "outline" | "secondary" | "destructive" | "ghost" | null | undefined;
|
|
8
8
|
size?: "icon" | "default" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
type Props = React$1.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
package/dist/core/button.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { cn } from "../utils.mjs";
|
|
3
3
|
import "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
|
7
7
|
//#region src/core/button.tsx
|
|
8
8
|
var button_exports = /* @__PURE__ */ __exportAll({
|
package/dist/core/calendar.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
4
|
import { Button, buttonVariants } from "./button.mjs";
|
|
5
|
-
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
6
5
|
import * as React$1 from "react";
|
|
6
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
9
9
|
//#region src/core/calendar.tsx
|
package/dist/core/checkbox.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
|
-
import { CheckIcon } from "lucide-react";
|
|
5
4
|
import "react";
|
|
5
|
+
import { CheckIcon } from "lucide-react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
8
8
|
//#region src/core/checkbox.tsx
|
package/dist/core/dialog.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
4
|
import { useConfig } from "../providers/config/context.mjs";
|
|
5
5
|
import Button from "../Button.mjs";
|
|
6
|
-
import { XIcon } from "lucide-react";
|
|
7
6
|
import "react";
|
|
7
|
+
import { XIcon } from "lucide-react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
10
10
|
//#region src/core/dialog.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
|
-
import { CircleIcon } from "lucide-react";
|
|
5
4
|
import "react";
|
|
5
|
+
import { CircleIcon } from "lucide-react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
8
8
|
//#region src/core/radio-group.tsx
|
package/dist/core/select.mjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
3
3
|
import { cn } from "../utils.mjs";
|
|
4
4
|
import { useConfig } from "../providers/config/context.mjs";
|
|
5
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
6
5
|
import "react";
|
|
6
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
9
9
|
//#region src/core/select.tsx
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "../utils.mjs";
|
|
2
|
+
//#region src/lib/chassis.ts
|
|
3
|
+
/**
|
|
4
|
+
* Shared a11y/state chassis for interactive single-element atoms (Button, Tag).
|
|
5
|
+
*
|
|
6
|
+
* Extracted from `core/button` and `core/badge`'s cva base strings during the
|
|
7
|
+
* #278 step ③ absorb (see #294 Phase 4). When an atom stops wrapping its core
|
|
8
|
+
* primitive it must carry this chassis itself — the focus ring, the
|
|
9
|
+
* `aria-invalid` treatment and the flex centering are load-bearing and have no
|
|
10
|
+
* type- or lint-level signal, so dropping them regresses silently (the #177
|
|
11
|
+
* class of bug the regression net in #300/#301 guards).
|
|
12
|
+
*
|
|
13
|
+
* Common set only. A Tag is not disableable, does not size icons and (as a
|
|
14
|
+
* non-focusable `span`) carries no `outline-none`, so those live on the Button
|
|
15
|
+
* extension in `atoms/button`, NOT here — folding them into one shared constant
|
|
16
|
+
* would push `disabled:*` onto Tag, which is semantically wrong (#301's
|
|
17
|
+
* per-component chassis finding).
|
|
18
|
+
*/
|
|
19
|
+
const INTERACTIVE_CHASSIS = cn("inline-flex items-center justify-center shrink-0", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive");
|
|
20
|
+
//#endregion
|
|
21
|
+
export { INTERACTIVE_CHASSIS };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=chassis.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chassis.mjs","names":[],"sources":["../../src/lib/chassis.ts"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\n/**\n * Shared a11y/state chassis for interactive single-element atoms (Button, Tag).\n *\n * Extracted from `core/button` and `core/badge`'s cva base strings during the\n * #278 step ③ absorb (see #294 Phase 4). When an atom stops wrapping its core\n * primitive it must carry this chassis itself — the focus ring, the\n * `aria-invalid` treatment and the flex centering are load-bearing and have no\n * type- or lint-level signal, so dropping them regresses silently (the #177\n * class of bug the regression net in #300/#301 guards).\n *\n * Common set only. A Tag is not disableable, does not size icons and (as a\n * non-focusable `span`) carries no `outline-none`, so those live on the Button\n * extension in `atoms/button`, NOT here — folding them into one shared constant\n * would push `disabled:*` onto Tag, which is semantically wrong (#301's\n * per-component chassis finding).\n */\nexport const INTERACTIVE_CHASSIS = cn(\n 'inline-flex items-center justify-center shrink-0',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAa,sBAAsB,GACjC,oDACA,iFACA,wGACF"}
|
|
@@ -3,8 +3,8 @@ import { cn } from "../../utils.mjs";
|
|
|
3
3
|
import { Context, DEFAULT_LOCALE, useConfig } from "./context.mjs";
|
|
4
4
|
import { registerRootConfig } from "./registry.mjs";
|
|
5
5
|
import { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from "react";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
6
|
import { DirectionProvider } from "@radix-ui/react-direction";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
//#region src/providers/config/config.tsx
|
|
9
9
|
const DARK_MEDIA_QUERY = "(prefers-color-scheme: dark)";
|
|
10
10
|
const subscribeToSystemColorScheme = (callback) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbpark/ui-kit",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.7",
|
|
4
4
|
"description": "Modern React UI component library built with TypeScript, Tailwind CSS, and Radix UI. Featuring atoms, molecules, organisms and layout templates for building beautiful interfaces.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -108,6 +108,10 @@
|
|
|
108
108
|
"build": "tsdown",
|
|
109
109
|
"lint": "eslint .",
|
|
110
110
|
"check-dynamic-classes": "node scripts/check-dynamic-tailwind-classes.mjs",
|
|
111
|
+
"check-api-surface": "node scripts/check-api-surface.mjs",
|
|
112
|
+
"check-preflight-reset": "node scripts/check-preflight-reset.mjs",
|
|
113
|
+
"check-ssr-smoke": "node --import ./scripts/loaders/css-stub.mjs scripts/check-ssr-smoke.mjs",
|
|
114
|
+
"check-regression-net": "pnpm run check-api-surface && pnpm run check-preflight-reset && pnpm run check-ssr-smoke",
|
|
111
115
|
"generate:component": "turbo gen react-component",
|
|
112
116
|
"check-types": "tsc -b",
|
|
113
117
|
"prepublishOnly": "node scripts/prepare-publish.mjs",
|