@jbpark/ui-kit 5.0.0 → 5.2.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/dist/Space.mjs +2 -0
- package/dist/Space.mjs.map +1 -1
- package/dist/components/atoms/checkbox/checkbox.mjs +11 -8
- package/dist/components/atoms/checkbox/checkbox.mjs.map +1 -1
- package/dist/components/atoms/radio/radio.mjs +11 -8
- package/dist/components/atoms/radio/radio.mjs.map +1 -1
- package/dist/components/atoms/skeleton/skeleton.mjs +1 -1
- package/dist/components/atoms/skeleton/skeleton.mjs.map +1 -1
- package/dist/components/molecules/dropdown.mjs +14 -12
- package/dist/components/molecules/dropdown.mjs.map +1 -1
- package/dist/components/molecules/menu/item/item.mjs.map +1 -1
- package/dist/components/organisms/imperative-stack.mjs +6 -4
- package/dist/components/organisms/imperative-stack.mjs.map +1 -1
- package/dist/components/organisms/modal.d.mts.map +1 -1
- package/dist/components/organisms/modal.mjs +12 -7
- package/dist/components/organisms/modal.mjs.map +1 -1
- package/dist/components/organisms/toast.d.mts.map +1 -1
- package/dist/components/organisms/toast.mjs +3 -1
- package/dist/components/organisms/toast.mjs.map +1 -1
- package/dist/components/templates/grid/col.d.mts.map +1 -1
- package/dist/components/templates/grid/col.mjs +35 -15
- package/dist/components/templates/grid/col.mjs.map +1 -1
- package/dist/components/templates/grid/row-context.mjs +1 -2
- package/dist/components/templates/grid/row-context.mjs.map +1 -1
- package/dist/components/templates/grid/row.d.mts.map +1 -1
- package/dist/components/templates/grid/row.mjs +2 -9
- package/dist/components/templates/grid/row.mjs.map +1 -1
- package/dist/components/templates/layout/content.d.mts.map +1 -1
- package/dist/components/templates/layout/content.mjs +5 -1
- package/dist/components/templates/layout/content.mjs.map +1 -1
- package/dist/components/templates/layout/sider.mjs +22 -7
- package/dist/components/templates/layout/sider.mjs.map +1 -1
- package/dist/components/templates/page-header.d.mts.map +1 -1
- package/dist/components/templates/page-header.mjs +3 -1
- package/dist/components/templates/page-header.mjs.map +1 -1
- package/dist/core/badge.d.mts +1 -1
- package/dist/core/button.d.mts +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/providers/config/config.d.mts.map +1 -1
- package/dist/providers/config/config.mjs +7 -1
- package/dist/providers/config/config.mjs.map +1 -1
- package/dist/providers/config/context.d.mts.map +1 -1
- package/dist/providers/config/context.mjs +4 -1
- package/dist/providers/config/context.mjs.map +1 -1
- package/dist/providers/config/index.d.mts +2 -1
- package/dist/providers/config/registry.d.mts +14 -0
- package/dist/providers/config/registry.d.mts.map +1 -0
- package/dist/providers/config/registry.mjs +26 -0
- package/dist/providers/config/registry.mjs.map +1 -0
- package/dist/providers/config/types.d.mts +3 -0
- package/dist/providers/config/types.d.mts.map +1 -1
- package/dist/providers.d.mts +2 -1
- package/dist/providers.mjs +2 -1
- package/dist/style.css +40 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/providers/config/context.ts"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\n\nimport type { ContextValue, Locale } from './types';\n\nexport const DEFAULT_LOCALE: Required<Locale> = {\n close: '닫기',\n clear: '지우기',\n backToTop: '맨 위로',\n loading: '로딩 중',\n expand: '펼치기',\n collapse: '접기',\n};\n\nexport const Context = createContext<ContextValue>({\n theme: {},\n locale: DEFAULT_LOCALE,\n getContainer: () => undefined,\n isConfigured: false,\n});\n\nexport const useConfig = () => useContext(Context);\n"],"mappings":";;;;;AAMA,MAAa,iBAAmC;CAC9C,OAAO;CACP,OAAO;CACP,WAAW;CACX,SAAS;CACT,QAAQ;CACR,UAAU;
|
|
1
|
+
{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/providers/config/context.ts"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\n\nimport type { ContextValue, Locale } from './types';\n\nexport const DEFAULT_LOCALE: Required<Locale> = {\n close: '닫기',\n clear: '지우기',\n backToTop: '맨 위로',\n loading: '로딩 중',\n expand: '펼치기',\n collapse: '접기',\n back: '뒤로가기',\n ok: 'OK',\n cancel: 'Cancel',\n};\n\nexport const Context = createContext<ContextValue>({\n theme: {},\n locale: DEFAULT_LOCALE,\n getContainer: () => undefined,\n isConfigured: false,\n});\n\nexport const useConfig = () => useContext(Context);\n"],"mappings":";;;;;AAMA,MAAa,iBAAmC;CAC9C,OAAO;CACP,OAAO;CACP,WAAW;CACX,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,IAAI;CACJ,QAAQ;CACT;AAED,MAAa,UAAU,cAA4B;CACjD,OAAO,EAAE;CACT,QAAQ;CACR,oBAAoB;CACpB,cAAc;CACf,CAAC;AAEF,MAAa,kBAAkB,WAAW,QAAQ"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ComponentSize, DefaultProps, Locale, ThemeConfig, ThemeToken } from "./types.mjs";
|
|
2
2
|
import { DEFAULT_LOCALE, useConfig } from "./context.mjs";
|
|
3
|
-
import { Config, Props } from "./config.mjs";
|
|
3
|
+
import { Config, Props } from "./config.mjs";
|
|
4
|
+
import { ConfigSnapshotProvider, getRootConfigValue } from "./registry.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContextValue } from "./types.mjs";
|
|
2
|
+
import * as react from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/providers/config/registry.d.ts
|
|
6
|
+
declare const getRootConfigValue: () => ContextValue | null;
|
|
7
|
+
declare const ConfigSnapshotProvider: ({
|
|
8
|
+
children
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) => string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ConfigSnapshotProvider, getRootConfigValue };
|
|
14
|
+
//# sourceMappingURL=registry.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.mts","names":[],"sources":["../../../src/providers/config/registry.tsx"],"mappings":";;;;;cAkCa,kBAAA,QAAyB,YAAA;AAAA,cAOzB,sBAAA;EAA0B;AAAA;EAGrC,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,2CACjB,QAAA,CAD0B,KAAA,CAC1B,SAAA,IAAA,OAAA,sCAAA,KAAA,CAAA,WAAA,GAAA,KAAA,CAAA,YAAA,mBAAA,KAAA,CAAA,qBAAA,SAAA,QAAA,CAAA,KAAA,CAAA,SAAA,wBAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Context } from "./context.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/providers/config/registry.tsx
|
|
7
|
+
let currentValue = null;
|
|
8
|
+
const registerRootConfig = (value) => {
|
|
9
|
+
currentValue = value;
|
|
10
|
+
return () => {
|
|
11
|
+
if (currentValue === value) currentValue = null;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
const getRootConfigValue = () => currentValue;
|
|
15
|
+
const ConfigSnapshotProvider = ({ children }) => {
|
|
16
|
+
const value = getRootConfigValue();
|
|
17
|
+
if (!value) return children;
|
|
18
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
19
|
+
value,
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ConfigSnapshotProvider, getRootConfigValue, registerRootConfig };
|
|
26
|
+
//# sourceMappingURL=registry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.mjs","names":[],"sources":["../../../src/providers/config/registry.tsx"],"sourcesContent":["'use client';\n\nimport { Context } from './context';\nimport type { ContextValue } from './types';\n\n// The imperative stack (Modal.*/Toast.*, see organisms/imperative-stack.tsx)\n// renders into its own React root, outside any <Config> ancestor — there's\n// no call-site component to read useConfig() from, since these are plain\n// function calls, not JSX. This module-level registry is how that root\n// finds a Config to inherit anyway: the app's root Config registers its\n// current context value here, and the stack re-wraps itself with it as a\n// snapshot at render time (not a live subscription — a Modal/Toast that's\n// already open won't pick up a Config change made after it was created,\n// same \"reflects state at creation\" behavior as everything else about the\n// imperative API being a one-shot call).\n//\n// Only the root Config (no Config ancestor of its own — see\n// `isRoot` in config.tsx) registers. A section-local nested Config (used\n// for one-off theming of part of a page) intentionally does not — an app-\n// wide `Modal.confirm()` call has no natural association with whichever\n// nested Config happened to render most recently, so it should inherit\n// the app's actual root configuration instead.\nlet currentValue: ContextValue | null = null;\n\nexport const registerRootConfig = (value: ContextValue): (() => void) => {\n currentValue = value;\n\n return () => {\n if (currentValue === value) {\n currentValue = null;\n }\n };\n};\n\nexport const getRootConfigValue = (): ContextValue | null => currentValue;\n\n// Wraps the imperative stack's rendered items with whatever the root\n// Config's snapshot currently is, so useConfig() inside Modal/Toast (and\n// anything they render) resolves theme/locale/componentSize/etc instead of\n// the raw context default. A no-op passthrough when no root Config has\n// registered (e.g. no <Config> anywhere in the app).\nexport const ConfigSnapshotProvider = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const value = getRootConfigValue();\n\n if (!value) {\n return children;\n }\n\n return <Context.Provider value={value}>{children}</Context.Provider>;\n};\n"],"mappings":";;;;;;AAsBA,IAAI,eAAoC;AAExC,MAAa,sBAAsB,UAAsC;AACvE,gBAAe;AAEf,cAAa;AACX,MAAI,iBAAiB,MACnB,gBAAe;;;AAKrB,MAAa,2BAAgD;AAO7D,MAAa,0BAA0B,EACrC,eAGI;CACJ,MAAM,QAAQ,oBAAoB;AAElC,KAAI,CAAC,MACH,QAAO;AAGT,QAAO,oBAAC,QAAQ;EAAgB;EAAQ;GAA4B"}
|
|
@@ -52,6 +52,9 @@ interface Locale {
|
|
|
52
52
|
loading?: string;
|
|
53
53
|
expand?: string;
|
|
54
54
|
collapse?: string;
|
|
55
|
+
back?: string;
|
|
56
|
+
ok?: string;
|
|
57
|
+
cancel?: string;
|
|
55
58
|
}
|
|
56
59
|
type ComponentSize = 'small' | 'middle' | 'large';
|
|
57
60
|
type DefaultProps = Record<string, Record<string, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../src/providers/config/types.ts"],"mappings":";UAAiB,UAAA;EAEf,YAAA;EACA,sBAAA;EACA,eAAA;EACA,eAAA;EACA,SAAA;EACA,mBAAA;EACA,YAAA;EACA,sBAAA;EACA,cAAA;EACA,wBAAA;EACA,UAAA;EACA,oBAAA;EACA,WAAA;EACA,qBAAA;EACA,gBAAA;EACA,WAAA;EACA,UAAA;EACA,SAAA;EASA,YAAA;EAIA,aAAA;EACA,kBAAA;EACA,mBAAA;EACA,SAAA;EACA,aAAA;EAGA,OAAA;EACA,iBAAA;EACA,cAAA;EACA,wBAAA;EACA,aAAA;EACA,uBAAA;EACA,aAAA;EACA,WAAA;EAGA,MAAA;EACA,MAAA;EACA,MAAA;EACA,MAAA;EACA,MAAA;EAGA,QAAA;EACA,QAAA;AAAA;AAAA,UAGe,WAAA;EACf,KAAA,GAAQ,UAAA;EAKR,SAAA,GAAY,UAAA;EASZ,IAAA;AAAA;AAAA,UAQe,MAAA;EACf,KAAA;EACA,KAAA;EACA,SAAA;EACA,OAAA;EACA,MAAA;EACA,QAAA;AAAA;AAAA,KAMU,aAAA;AAAA,KAYA,YAAA,GAAe,MAAA,SAAe,MAAA;AAAA,UAEzB,YAAA;EACf,KAAA,EAAO,WAAA;EACP,MAAA,EAAQ,MAAA;EACR,SAAA;EAUA,YAAA,QAAoB,WAAA;EACpB,aAAA,GAAgB,aAAA;EAChB,YAAA,GAAe,YAAA;EAKf,YAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../src/providers/config/types.ts"],"mappings":";UAAiB,UAAA;EAEf,YAAA;EACA,sBAAA;EACA,eAAA;EACA,eAAA;EACA,SAAA;EACA,mBAAA;EACA,YAAA;EACA,sBAAA;EACA,cAAA;EACA,wBAAA;EACA,UAAA;EACA,oBAAA;EACA,WAAA;EACA,qBAAA;EACA,gBAAA;EACA,WAAA;EACA,UAAA;EACA,SAAA;EASA,YAAA;EAIA,aAAA;EACA,kBAAA;EACA,mBAAA;EACA,SAAA;EACA,aAAA;EAGA,OAAA;EACA,iBAAA;EACA,cAAA;EACA,wBAAA;EACA,aAAA;EACA,uBAAA;EACA,aAAA;EACA,WAAA;EAGA,MAAA;EACA,MAAA;EACA,MAAA;EACA,MAAA;EACA,MAAA;EAGA,QAAA;EACA,QAAA;AAAA;AAAA,UAGe,WAAA;EACf,KAAA,GAAQ,UAAA;EAKR,SAAA,GAAY,UAAA;EASZ,IAAA;AAAA;AAAA,UAQe,MAAA;EACf,KAAA;EACA,KAAA;EACA,SAAA;EACA,OAAA;EACA,MAAA;EACA,QAAA;EACA,IAAA;EACA,EAAA;EACA,MAAA;AAAA;AAAA,KAMU,aAAA;AAAA,KAYA,YAAA,GAAe,MAAA,SAAe,MAAA;AAAA,UAEzB,YAAA;EACf,KAAA,EAAO,WAAA;EACP,MAAA,EAAQ,MAAA;EACR,SAAA;EAUA,YAAA,QAAoB,WAAA;EACpB,aAAA,GAAgB,aAAA;EAChB,YAAA,GAAe,YAAA;EAKf,YAAA;AAAA"}
|
package/dist/providers.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentSize, DefaultProps, Locale, ThemeConfig, ThemeToken } from "./providers/config/types.mjs";
|
|
2
2
|
import { DEFAULT_LOCALE, useConfig } from "./providers/config/context.mjs";
|
|
3
3
|
import { Config, Props } from "./providers/config/config.mjs";
|
|
4
|
+
import { ConfigSnapshotProvider, getRootConfigValue } from "./providers/config/registry.mjs";
|
|
4
5
|
import "./providers/config/index.mjs";
|
|
5
|
-
export { type ComponentSize, Config, type Props as ConfigProps, DEFAULT_LOCALE, type DefaultProps, type Locale, type ThemeConfig, type ThemeToken, useConfig };
|
|
6
|
+
export { type ComponentSize, Config, type Props as ConfigProps, ConfigSnapshotProvider, DEFAULT_LOCALE, type DefaultProps, type Locale, type ThemeConfig, type ThemeToken, getRootConfigValue, useConfig };
|
package/dist/providers.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_LOCALE, useConfig } from "./providers/config/context.mjs";
|
|
2
|
+
import { ConfigSnapshotProvider, getRootConfigValue } from "./providers/config/registry.mjs";
|
|
2
3
|
import Config from "./providers/config/config.mjs";
|
|
3
4
|
|
|
4
|
-
export { Config, DEFAULT_LOCALE, useConfig };
|
|
5
|
+
export { Config, ConfigSnapshotProvider, DEFAULT_LOCALE, getRootConfigValue, useConfig };
|
package/dist/style.css
CHANGED
|
@@ -3599,6 +3599,46 @@
|
|
|
3599
3599
|
[data-slot='button'][data-color='gold'] {
|
|
3600
3600
|
--btn-bg: #f59e0b;
|
|
3601
3601
|
}
|
|
3602
|
+
[data-slot='col'] {
|
|
3603
|
+
flex-basis: calc(var(--col-span-xs) / 24 * 100%);
|
|
3604
|
+
max-width: calc(var(--col-span-xs) / 24 * 100%);
|
|
3605
|
+
margin-left: calc(var(--col-offset-xs, 0) / 24 * 100%);
|
|
3606
|
+
}
|
|
3607
|
+
@media (width >= 40rem) {
|
|
3608
|
+
[data-slot='col'] {
|
|
3609
|
+
flex-basis: calc(var(--col-span-sm) / 24 * 100%);
|
|
3610
|
+
max-width: calc(var(--col-span-sm) / 24 * 100%);
|
|
3611
|
+
margin-left: calc(var(--col-offset-sm, 0) / 24 * 100%);
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3614
|
+
@media (width >= 48rem) {
|
|
3615
|
+
[data-slot='col'] {
|
|
3616
|
+
flex-basis: calc(var(--col-span-md) / 24 * 100%);
|
|
3617
|
+
max-width: calc(var(--col-span-md) / 24 * 100%);
|
|
3618
|
+
margin-left: calc(var(--col-offset-md, 0) / 24 * 100%);
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
@media (width >= 64rem) {
|
|
3622
|
+
[data-slot='col'] {
|
|
3623
|
+
flex-basis: calc(var(--col-span-lg) / 24 * 100%);
|
|
3624
|
+
max-width: calc(var(--col-span-lg) / 24 * 100%);
|
|
3625
|
+
margin-left: calc(var(--col-offset-lg, 0) / 24 * 100%);
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
@media (width >= 80rem) {
|
|
3629
|
+
[data-slot='col'] {
|
|
3630
|
+
flex-basis: calc(var(--col-span-xl) / 24 * 100%);
|
|
3631
|
+
max-width: calc(var(--col-span-xl) / 24 * 100%);
|
|
3632
|
+
margin-left: calc(var(--col-offset-xl, 0) / 24 * 100%);
|
|
3633
|
+
}
|
|
3634
|
+
}
|
|
3635
|
+
@media (width >= 96rem) {
|
|
3636
|
+
[data-slot='col'] {
|
|
3637
|
+
flex-basis: calc(var(--col-span-2xl) / 24 * 100%);
|
|
3638
|
+
max-width: calc(var(--col-span-2xl) / 24 * 100%);
|
|
3639
|
+
margin-left: calc(var(--col-offset-2xl, 0) / 24 * 100%);
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3602
3642
|
}
|
|
3603
3643
|
@property --tw-translate-x {
|
|
3604
3644
|
syntax: "*";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbpark/ui-kit",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
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",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@gsap/react": "^2.1.2",
|
|
130
|
-
"@jbpark/use-hooks": "^
|
|
130
|
+
"@jbpark/use-hooks": "^4.0.0",
|
|
131
131
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
132
132
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
133
133
|
"@radix-ui/react-dialog": "^1.1.15",
|