@kjun-ui/react 0.12.2 → 0.13.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/index.cjs +1469 -1065
- package/dist/index.js +1105 -701
- package/dist/styles.css +30 -3
- package/dist/types/packages/react/src/button.d.cts +2 -0
- package/dist/types/packages/react/src/button.d.ts +2 -0
- package/dist/types/packages/react/src/controls.d.cts +3 -1
- package/dist/types/packages/react/src/controls.d.ts +3 -1
- package/dist/types/packages/react/src/data-state.d.cts +3 -0
- package/dist/types/packages/react/src/data-state.d.ts +3 -0
- package/dist/types/packages/react/src/date-picker.d.cts +3 -1
- package/dist/types/packages/react/src/date-picker.d.ts +3 -1
- package/dist/types/packages/react/src/fab.d.cts +14 -0
- package/dist/types/packages/react/src/fab.d.ts +14 -0
- package/dist/types/packages/react/src/financial-display.d.cts +8 -8
- package/dist/types/packages/react/src/financial-display.d.ts +8 -8
- package/dist/types/packages/react/src/index.d.cts +2 -0
- package/dist/types/packages/react/src/index.d.ts +2 -0
- package/dist/types/packages/react/src/input.d.cts +3 -1
- package/dist/types/packages/react/src/input.d.ts +3 -1
- package/dist/types/packages/react/src/list.d.cts +5 -1
- package/dist/types/packages/react/src/list.d.ts +5 -1
- package/dist/types/packages/react/src/provider.d.cts +6 -1
- package/dist/types/packages/react/src/provider.d.ts +6 -1
- package/dist/types/shared/package-runtime/feedback-dialog.d.cts +2 -1
- package/dist/types/shared/package-runtime/feedback-dialog.d.ts +2 -1
- package/dist/types/shared/package-runtime/messages/en.d.cts +2 -0
- package/dist/types/shared/package-runtime/messages/en.d.ts +2 -0
- package/dist/types/shared/package-runtime/messages/index.d.cts +26 -0
- package/dist/types/shared/package-runtime/messages/index.d.ts +26 -0
- package/dist/types/shared/package-runtime/messages/ko.d.cts +116 -0
- package/dist/types/shared/package-runtime/messages/ko.d.ts +116 -0
- package/dist/types/shared/package-runtime/messages-context.d.cts +124 -0
- package/dist/types/shared/package-runtime/messages-context.d.ts +124 -0
- package/dist/types/shared/package-runtime/options.d.cts +4 -2
- package/dist/types/shared/package-runtime/options.d.ts +4 -2
- package/dist/types/shared/package-runtime/relative-time.d.cts +1 -1
- package/dist/types/shared/package-runtime/relative-time.d.ts +1 -1
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
--_kjun-color-brand-light: var(--kjun-brand-light, var(--kjun-border));
|
|
79
79
|
--_kjun-color-selected-bg: var(--kjun-selected-bg, var(--kjun-active));
|
|
80
80
|
--_kjun-color-on-brand: var(--kjun-on-brand, var(--kjun-inverse));
|
|
81
|
+
--_kjun-color-switch-thumb-on: var(--kjun-switch-thumb-on, var(--kjun-on-brand, var(--kjun-inverse)));
|
|
81
82
|
--_kjun-color-on-danger: var(--kjun-on-danger, var(--kjun-inverse));
|
|
82
83
|
--_kjun-color-on-success: var(--kjun-on-success, var(--kjun-inverse));
|
|
83
84
|
--_kjun-color-on-warning: var(--kjun-on-warning, var(--kjun-inverse));
|
|
@@ -180,6 +181,7 @@
|
|
|
180
181
|
--_kjun-brand-light: var(--_kjun-color-brand-light);
|
|
181
182
|
--_kjun-selected-bg: var(--_kjun-color-selected-bg);
|
|
182
183
|
--_kjun-on-brand: var(--_kjun-color-on-brand);
|
|
184
|
+
--_kjun-switch-thumb-on: var(--_kjun-color-switch-thumb-on);
|
|
183
185
|
--_kjun-on-danger: var(--_kjun-color-on-danger);
|
|
184
186
|
--_kjun-on-success: var(--_kjun-color-on-success);
|
|
185
187
|
--_kjun-on-warning: var(--_kjun-color-on-warning);
|
|
@@ -256,9 +258,14 @@
|
|
|
256
258
|
--_kjun-extension-state-padding-sm: 24px;
|
|
257
259
|
--_kjun-extension-state-padding-md: 48px;
|
|
258
260
|
--_kjun-extension-state-padding-lg: 80px;
|
|
261
|
+
--_kjun-extension-fab-size: 56px;
|
|
262
|
+
--_kjun-extension-fab-inset: 16px;
|
|
263
|
+
--_kjun-extension-fab-icon-size: 24px;
|
|
259
264
|
--_kjun-extension-list-padding: 16px;
|
|
260
265
|
--_kjun-extension-list-gap: 12px;
|
|
261
266
|
--_kjun-extension-list-minimum-height: 56px;
|
|
267
|
+
--_kjun-extension-list-compact-minimum-height: 44px;
|
|
268
|
+
--_kjun-extension-list-compact-padding-y: 12px;
|
|
262
269
|
--_kjun-extension-list-description-gap: 4px;
|
|
263
270
|
--_kjun-extension-list-actions-gap: 8px;
|
|
264
271
|
--_kjun-extension-list-actions-padding: 16px;
|
|
@@ -1255,6 +1262,11 @@
|
|
|
1255
1262
|
.kjun-scope .kjun-choice:not(.kjun-choice--disabled):active .kjun-radio,
|
|
1256
1263
|
.kjun-scope .kjun-choice:not(.kjun-choice--disabled) input:active + .kjun-radio { border-color: var(--_kjun-brand-active); }
|
|
1257
1264
|
.kjun-scope .kjun-switch + .kjun-choice-label { margin-left: var(--_kjun-extension-switch-label-gap); }
|
|
1265
|
+
/* A switch description sits under its label and starts where the label starts. */
|
|
1266
|
+
.kjun-scope .kjun-choice-text { display: flex; flex-direction: column; min-width: 0; }
|
|
1267
|
+
.kjun-scope .kjun-switch + .kjun-choice-text { margin-left: var(--_kjun-extension-switch-label-gap); }
|
|
1268
|
+
.kjun-scope .kjun-choice-text > .kjun-choice-label { margin-left: 0; }
|
|
1269
|
+
.kjun-scope .kjun-choice-description { margin-top: var(--_kjun-geometry-dimension-value4); font-size: var(--_kjun-type-caption-size); line-height: var(--_kjun-type-caption-line); font-weight: var(--_kjun-type-caption-weight); letter-spacing: var(--_kjun-type-caption-tracking); color: var(--_kjun-color-text-secondary); }
|
|
1258
1270
|
.kjun-scope .kjun-switch {
|
|
1259
1271
|
position: relative;
|
|
1260
1272
|
flex-shrink: 0;
|
|
@@ -1289,7 +1301,7 @@
|
|
|
1289
1301
|
.kjun-scope .kjun-switch--on .kjun-switch-thumb {
|
|
1290
1302
|
--_kjun-switch-thumb-inset: var(--_kjun-extension-switch-padding);
|
|
1291
1303
|
margin: 0;
|
|
1292
|
-
background: var(--_kjun-on
|
|
1304
|
+
background: var(--_kjun-switch-thumb-on);
|
|
1293
1305
|
transform: translateX(calc(var(--_kjun-switch-width) - var(--_kjun-switch-height)));
|
|
1294
1306
|
}
|
|
1295
1307
|
|
|
@@ -1506,6 +1518,10 @@
|
|
|
1506
1518
|
.kjun-button[data-variant="secondary"]:active:not(:disabled) {
|
|
1507
1519
|
background: var(--_kjun-color-button-secondary-active);
|
|
1508
1520
|
}
|
|
1521
|
+
/* A link button hugs its text: no fill, no inset, the brand ink, underlined on hover and keyboard focus. */
|
|
1522
|
+
.kjun-button[data-variant="link"] { background: transparent; color: var(--_kjun-color-brand); }
|
|
1523
|
+
.kjun-button[data-variant="link"]:is(:hover, [data-focus-visible], :focus-visible):not(:disabled) { text-decoration: underline; }
|
|
1524
|
+
.kjun-button[data-variant="link"]:active:not(:disabled) { color: var(--_kjun-color-brand-active); }
|
|
1509
1525
|
.kjun-button[data-variant="ghost"],
|
|
1510
1526
|
.kjun-button[data-variant="danger-ghost"] {
|
|
1511
1527
|
background: transparent;
|
|
@@ -1592,6 +1608,7 @@
|
|
|
1592
1608
|
.kjun-form-group:last-child {
|
|
1593
1609
|
margin-bottom: 0;
|
|
1594
1610
|
}
|
|
1611
|
+
.kjun-form-optional { color: var(--_kjun-color-text-tertiary); font-weight: var(--_kjun-type-caption-weight); }
|
|
1595
1612
|
.kjun-form-label {
|
|
1596
1613
|
display: block;
|
|
1597
1614
|
font-size: var(--_kjun-type-label-size);
|
|
@@ -2273,18 +2290,22 @@
|
|
|
2273
2290
|
cursor: pointer;
|
|
2274
2291
|
transition: color var(--_kjun-motion-indicator) var(--_kjun-ease-out);
|
|
2275
2292
|
}
|
|
2293
|
+
/* The selected segment carries an inset edge so it reads apart from the track even when surface and
|
|
2294
|
+
secondary are close (light palettes). Inset keeps the segment's size. */
|
|
2276
2295
|
.kjun-button-group button[aria-pressed="true"] {
|
|
2277
2296
|
background: var(--_kjun-color-surface);
|
|
2297
|
+
box-shadow: inset 0 0 0 var(--_kjun-border-default-width) var(--_kjun-color-border);
|
|
2278
2298
|
color: var(--_kjun-color-text);
|
|
2279
2299
|
font-weight: var(--_kjun-type-control-weight);
|
|
2280
2300
|
}
|
|
2281
|
-
.kjun-button-group[data-indicator] button[aria-pressed="true"] { background: transparent; }
|
|
2301
|
+
.kjun-button-group[data-indicator] button[aria-pressed="true"] { background: transparent; box-shadow: none; }
|
|
2282
2302
|
.kjun-button-group-indicator {
|
|
2283
2303
|
position: absolute;
|
|
2284
2304
|
left: 0;
|
|
2285
2305
|
pointer-events: none;
|
|
2286
2306
|
border-radius: var(--_kjun-geometry-button-group-item-radii-md);
|
|
2287
2307
|
background: var(--_kjun-color-surface);
|
|
2308
|
+
box-shadow: inset 0 0 0 var(--_kjun-border-default-width) var(--_kjun-color-border);
|
|
2288
2309
|
}
|
|
2289
2310
|
.kjun-button-group-indicator[data-animate="true"] {
|
|
2290
2311
|
transition: transform var(--_kjun-motion-indicator) var(--_kjun-ease-out), width var(--_kjun-motion-indicator) var(--_kjun-ease-out);
|
|
@@ -4724,7 +4745,7 @@
|
|
|
4724
4745
|
|
|
4725
4746
|
.kjun-list-section,.kjun-top-navigation,.kjun-bottom-navigation,.kjun-bottom-action-bar{min-width:0;max-width:100%;color:var(--_kjun-color-text);background:var(--_kjun-color-surface)}
|
|
4726
4747
|
.kjun-list-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--_kjun-extension-list-gap);padding:var(--_kjun-extension-list-padding)}.kjun-list-heading h3{font-size:var(--_kjun-type-card-title-size);margin:0;line-height:var(--_kjun-type-card-title-line);font-weight:var(--_kjun-type-card-title-weight);letter-spacing:var(--_kjun-type-card-title-tracking)}.kjun-list-heading p{margin:var(--_kjun-geometry-dimension-value4) 0 0;font-size:var(--_kjun-type-caption-size);color:var(--_kjun-color-text-secondary);overflow-wrap:anywhere;line-height:var(--_kjun-type-caption-line);font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking)}
|
|
4727
|
-
.kjun-list{list-style:none;padding:0;margin:0}.kjun-list-row{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);border-bottom:var(--_kjun-border-default-width) solid var(--_kjun-color-divider);min-width:0}.kjun-list-row:last-child{border-bottom:0}.kjun-list-main{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);flex:1;min-width:0;min-height:var(--_kjun-extension-list-minimum-height);padding:var(--_kjun-extension-list-padding);text-align:start;color:inherit;text-decoration:none;background:transparent;border:0;font:inherit}.kjun-list-main:is(button,a):hover{background:var(--_kjun-color-hover)}.kjun-list-body{flex:1;min-width:0}.kjun-list-title,.kjun-list-description{display:block;overflow-wrap:anywhere;line-height:1.5}.kjun-list-title{font-size:var(--_kjun-type-label-size);line-height:var(--_kjun-type-label-line);font-weight:var(--_kjun-type-label-weight);letter-spacing:var(--_kjun-type-label-tracking)}.kjun-list-description{font-size:var(--_kjun-type-caption-size);color:var(--_kjun-color-text-secondary);line-height:var(--_kjun-type-caption-line);font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking)}.kjun-list-leading{flex-shrink:0}.kjun-list-trailing{overflow-wrap:anywhere;max-width:35%}.kjun-list-actions{display:flex;flex-wrap:wrap;gap:var(--_kjun-extension-list-actions-gap);padding-inline-end:var(--_kjun-extension-list-actions-padding);max-width:45%}
|
|
4748
|
+
.kjun-list{list-style:none;padding:0;margin:0}.kjun-list-row{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);border-bottom:var(--_kjun-border-default-width) solid var(--_kjun-color-divider);min-width:0}.kjun-list-row:last-child{border-bottom:0}.kjun-list[data-divider=false]>.kjun-list-row{border-bottom:0}.kjun-list[data-density=compact] .kjun-list-main{min-height:var(--_kjun-extension-list-compact-minimum-height);padding-block:var(--_kjun-extension-list-compact-padding-y)}.kjun-list-main{display:flex;align-items:center;gap:var(--_kjun-extension-list-gap);flex:1;min-width:0;min-height:var(--_kjun-extension-list-minimum-height);padding:var(--_kjun-extension-list-padding);text-align:start;color:inherit;text-decoration:none;background:transparent;border:0;font:inherit}.kjun-list-main:is(button,a):hover{background:var(--_kjun-color-hover)}.kjun-list-body{flex:1;min-width:0}.kjun-list-title,.kjun-list-description{display:block;overflow-wrap:anywhere;line-height:1.5}.kjun-list-title{font-size:var(--_kjun-type-label-size);line-height:var(--_kjun-type-label-line);font-weight:var(--_kjun-type-label-weight);letter-spacing:var(--_kjun-type-label-tracking)}.kjun-list-description{font-size:var(--_kjun-type-caption-size);color:var(--_kjun-color-text-secondary);line-height:var(--_kjun-type-caption-line);font-weight:var(--_kjun-type-caption-weight);letter-spacing:var(--_kjun-type-caption-tracking)}.kjun-list-leading{flex-shrink:0}.kjun-list-trailing{overflow-wrap:anywhere;max-width:35%}.kjun-list-actions{display:flex;flex-wrap:wrap;gap:var(--_kjun-extension-list-actions-gap);padding-inline-end:var(--_kjun-extension-list-actions-padding);max-width:45%}
|
|
4728
4749
|
/* A disabled row disables its actions too, so the row never reads as partly available. */
|
|
4729
4750
|
.kjun-list-actions[data-disabled]{opacity:var(--_kjun-state-opacity-disabled)}
|
|
4730
4751
|
.kjun-navigation-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:var(--_kjun-extension-navigation-actions-gap);min-width:0}
|
|
@@ -4937,6 +4958,12 @@
|
|
|
4937
4958
|
|
|
4938
4959
|
.kjun-list-heading > div { flex:1; min-width:0; overflow-wrap:anywhere; }
|
|
4939
4960
|
|
|
4961
|
+
/* KjunFab: a round action pinned to the viewport's bottom end, above page content and clear of the safe area. */
|
|
4962
|
+
.kjun-fab{position:fixed;right:var(--_kjun-extension-fab-inset);z-index:var(--_kjun-layer-page-navigation);display:inline-flex;align-items:center;justify-content:center;width:var(--_kjun-extension-fab-size);height:var(--_kjun-extension-fab-size);padding:0;border:0;border-radius:50%;background:var(--_kjun-color-brand);color:var(--_kjun-color-on-brand);box-shadow:var(--_kjun-elevation-floating);cursor:pointer}
|
|
4963
|
+
.kjun-fab:hover:not(:disabled){background:var(--_kjun-color-brand-hover)}.kjun-fab:active:not(:disabled){background:var(--_kjun-color-brand-active)}
|
|
4964
|
+
.kjun-fab:focus-visible{outline:var(--_kjun-state-focus-width) solid var(--_kjun-color-focus-ring);outline-offset:var(--_kjun-state-focus-offset)}
|
|
4965
|
+
.kjun-fab:disabled{opacity:var(--_kjun-state-opacity-disabled);cursor:not-allowed}
|
|
4966
|
+
|
|
4940
4967
|
/* Compound fields share input geometry; buttons retain their own size contract. */
|
|
4941
4968
|
.kjun-quantity,.kjun-time-picker {
|
|
4942
4969
|
--_kjun-compound-height: var(--_kjun-geometry-input-md-height);
|
|
@@ -11,6 +11,8 @@ export declare function useMinimumLoading(loading: boolean): boolean;
|
|
|
11
11
|
export interface KjunButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> {
|
|
12
12
|
variant?: ButtonVariant;
|
|
13
13
|
size?: ButtonSize;
|
|
14
|
+
/** "circle" makes an icon-only button round: as wide as its height with a full radius. */
|
|
15
|
+
shape?: "default" | "circle";
|
|
14
16
|
loading?: boolean;
|
|
15
17
|
block?: boolean;
|
|
16
18
|
/** Long labels wrap: the size's height becomes a minimum and the button grows instead of overflowing. */
|
|
@@ -11,6 +11,8 @@ export declare function useMinimumLoading(loading: boolean): boolean;
|
|
|
11
11
|
export interface KjunButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> {
|
|
12
12
|
variant?: ButtonVariant;
|
|
13
13
|
size?: ButtonSize;
|
|
14
|
+
/** "circle" makes an icon-only button round: as wide as its height with a full radius. */
|
|
15
|
+
shape?: "default" | "circle";
|
|
14
16
|
loading?: boolean;
|
|
15
17
|
block?: boolean;
|
|
16
18
|
/** Long labels wrap: the size's height becomes a minimum and the button grows instead of overflowing. */
|
|
@@ -27,11 +27,13 @@ export interface KjunSwitchProps {
|
|
|
27
27
|
ariaLabel?: string;
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
size?: InputSize;
|
|
30
|
+
/** Supporting text under the label; it also describes the switch to screen readers. */
|
|
31
|
+
description?: string;
|
|
30
32
|
children?: ReactNode;
|
|
31
33
|
onValueChange?: (value: boolean) => void;
|
|
32
34
|
onChange?: (value: boolean) => void;
|
|
33
35
|
}
|
|
34
|
-
export declare function KjunSwitch({ value, label, ariaLabel, disabled, size, children, onValueChange, onChange, }: KjunSwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function KjunSwitch({ value, label, ariaLabel, disabled, size, description, children, onValueChange, onChange, }: KjunSwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
35
37
|
export interface KjunRadioProps {
|
|
36
38
|
value?: ChoiceValue;
|
|
37
39
|
val: ChoiceValue;
|
|
@@ -27,11 +27,13 @@ export interface KjunSwitchProps {
|
|
|
27
27
|
ariaLabel?: string;
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
size?: InputSize;
|
|
30
|
+
/** Supporting text under the label; it also describes the switch to screen readers. */
|
|
31
|
+
description?: string;
|
|
30
32
|
children?: ReactNode;
|
|
31
33
|
onValueChange?: (value: boolean) => void;
|
|
32
34
|
onChange?: (value: boolean) => void;
|
|
33
35
|
}
|
|
34
|
-
export declare function KjunSwitch({ value, label, ariaLabel, disabled, size, children, onValueChange, onChange, }: KjunSwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function KjunSwitch({ value, label, ariaLabel, disabled, size, description, children, onValueChange, onChange, }: KjunSwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
35
37
|
export interface KjunRadioProps {
|
|
36
38
|
value?: ChoiceValue;
|
|
37
39
|
val: ChoiceValue;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { KjunMessageScope } from "../../../shared/package-runtime/messages/index.cjs";
|
|
1
2
|
import { type QueryDisplayProps } from "@kjun-ui/tokens";
|
|
2
3
|
import { Component, type ErrorInfo, type ReactNode } from "react";
|
|
3
4
|
import { type KjunSkeletonProps } from "./display.cjs";
|
|
@@ -44,6 +45,8 @@ export interface KjunErrorBoundaryProps {
|
|
|
44
45
|
export declare class KjunErrorBoundary extends Component<KjunErrorBoundaryProps, {
|
|
45
46
|
error: boolean;
|
|
46
47
|
}> {
|
|
48
|
+
static contextType: import("react").Context<KjunMessageScope>;
|
|
49
|
+
context: KjunMessageScope;
|
|
47
50
|
state: {
|
|
48
51
|
error: boolean;
|
|
49
52
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { KjunMessageScope } from "../../../shared/package-runtime/messages/index.js";
|
|
1
2
|
import { type QueryDisplayProps } from "@kjun-ui/tokens";
|
|
2
3
|
import { Component, type ErrorInfo, type ReactNode } from "react";
|
|
3
4
|
import { type KjunSkeletonProps } from "./display.js";
|
|
@@ -44,6 +45,8 @@ export interface KjunErrorBoundaryProps {
|
|
|
44
45
|
export declare class KjunErrorBoundary extends Component<KjunErrorBoundaryProps, {
|
|
45
46
|
error: boolean;
|
|
46
47
|
}> {
|
|
48
|
+
static contextType: import("react").Context<KjunMessageScope>;
|
|
49
|
+
context: KjunMessageScope;
|
|
47
50
|
state: {
|
|
48
51
|
error: boolean;
|
|
49
52
|
};
|
|
@@ -3,8 +3,10 @@ import { type InputHTMLAttributes } from "react";
|
|
|
3
3
|
export interface KjunDatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value"> {
|
|
4
4
|
value: string;
|
|
5
5
|
size?: InputSize;
|
|
6
|
+
/** Shows a clear button while there is a value; it reports an empty string. */
|
|
7
|
+
clearable?: boolean;
|
|
6
8
|
ariaLabel?: string;
|
|
7
9
|
error?: boolean;
|
|
8
10
|
onValueChange?: (v: string) => void;
|
|
9
11
|
}
|
|
10
|
-
export declare function KjunDatePicker({ value, size, placeholder, ariaLabel, error, onValueChange, onFocus, onBlur, ...props }: KjunDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function KjunDatePicker({ value, size, clearable, placeholder, ariaLabel, error, onValueChange, onFocus, onBlur, ...props }: KjunDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,8 +3,10 @@ import { type InputHTMLAttributes } from "react";
|
|
|
3
3
|
export interface KjunDatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value"> {
|
|
4
4
|
value: string;
|
|
5
5
|
size?: InputSize;
|
|
6
|
+
/** Shows a clear button while there is a value; it reports an empty string. */
|
|
7
|
+
clearable?: boolean;
|
|
6
8
|
ariaLabel?: string;
|
|
7
9
|
error?: boolean;
|
|
8
10
|
onValueChange?: (v: string) => void;
|
|
9
11
|
}
|
|
10
|
-
export declare function KjunDatePicker({ value, size, placeholder, ariaLabel, error, onValueChange, onFocus, onBlur, ...props }: KjunDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function KjunDatePicker({ value, size, clearable, placeholder, ariaLabel, error, onValueChange, onFocus, onBlur, ...props }: KjunDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MouseEvent } from "react";
|
|
2
|
+
export interface KjunFabProps {
|
|
3
|
+
icon: string;
|
|
4
|
+
/** The FAB has no visible text, so it needs a name. */
|
|
5
|
+
ariaLabel: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Bottom safe area (px) the FAB stays above. */
|
|
8
|
+
safeAreaBottom?: number;
|
|
9
|
+
/** Extra space below, e.g. a bottom navigation's height. */
|
|
10
|
+
offsetBottom?: number;
|
|
11
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
/** A round primary action pinned to the bottom end of the viewport. */
|
|
14
|
+
export declare function KjunFab({ icon, ariaLabel, disabled, safeAreaBottom, offsetBottom, onClick }: KjunFabProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MouseEvent } from "react";
|
|
2
|
+
export interface KjunFabProps {
|
|
3
|
+
icon: string;
|
|
4
|
+
/** The FAB has no visible text, so it needs a name. */
|
|
5
|
+
ariaLabel: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Bottom safe area (px) the FAB stays above. */
|
|
8
|
+
safeAreaBottom?: number;
|
|
9
|
+
/** Extra space below, e.g. a bottom navigation's height. */
|
|
10
|
+
offsetBottom?: number;
|
|
11
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
/** A round primary action pinned to the bottom end of the viewport. */
|
|
14
|
+
export declare function KjunFab({ icon, ariaLabel, disabled, safeAreaBottom, offsetBottom, onClick }: KjunFabProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,35 +35,35 @@ export declare function KjunCollectionMark({ kind, active, size, }: KjunCollecti
|
|
|
35
35
|
export declare const executionStates: {
|
|
36
36
|
readonly queued: readonly [
|
|
37
37
|
"secondary",
|
|
38
|
-
"
|
|
38
|
+
"statusQueued"
|
|
39
39
|
];
|
|
40
40
|
readonly starting: readonly [
|
|
41
41
|
"primary",
|
|
42
|
-
"
|
|
42
|
+
"statusStarting"
|
|
43
43
|
];
|
|
44
44
|
readonly running: readonly [
|
|
45
45
|
"primary",
|
|
46
|
-
"
|
|
46
|
+
"statusRunning"
|
|
47
47
|
];
|
|
48
48
|
readonly stopping: readonly [
|
|
49
49
|
"warning",
|
|
50
|
-
"
|
|
50
|
+
"statusStopping"
|
|
51
51
|
];
|
|
52
52
|
readonly stopped: readonly [
|
|
53
53
|
"secondary",
|
|
54
|
-
"
|
|
54
|
+
"statusStopped"
|
|
55
55
|
];
|
|
56
56
|
readonly completed: readonly [
|
|
57
57
|
"success",
|
|
58
|
-
"
|
|
58
|
+
"statusCompleted"
|
|
59
59
|
];
|
|
60
60
|
readonly completed_with_errors: readonly [
|
|
61
61
|
"warning",
|
|
62
|
-
"
|
|
62
|
+
"statusCompletedWithErrors"
|
|
63
63
|
];
|
|
64
64
|
readonly failed: readonly [
|
|
65
65
|
"danger",
|
|
66
|
-
"
|
|
66
|
+
"statusFailed"
|
|
67
67
|
];
|
|
68
68
|
};
|
|
69
69
|
export interface KjunExecutionStatusBadgeProps {
|
|
@@ -35,35 +35,35 @@ export declare function KjunCollectionMark({ kind, active, size, }: KjunCollecti
|
|
|
35
35
|
export declare const executionStates: {
|
|
36
36
|
readonly queued: readonly [
|
|
37
37
|
"secondary",
|
|
38
|
-
"
|
|
38
|
+
"statusQueued"
|
|
39
39
|
];
|
|
40
40
|
readonly starting: readonly [
|
|
41
41
|
"primary",
|
|
42
|
-
"
|
|
42
|
+
"statusStarting"
|
|
43
43
|
];
|
|
44
44
|
readonly running: readonly [
|
|
45
45
|
"primary",
|
|
46
|
-
"
|
|
46
|
+
"statusRunning"
|
|
47
47
|
];
|
|
48
48
|
readonly stopping: readonly [
|
|
49
49
|
"warning",
|
|
50
|
-
"
|
|
50
|
+
"statusStopping"
|
|
51
51
|
];
|
|
52
52
|
readonly stopped: readonly [
|
|
53
53
|
"secondary",
|
|
54
|
-
"
|
|
54
|
+
"statusStopped"
|
|
55
55
|
];
|
|
56
56
|
readonly completed: readonly [
|
|
57
57
|
"success",
|
|
58
|
-
"
|
|
58
|
+
"statusCompleted"
|
|
59
59
|
];
|
|
60
60
|
readonly completed_with_errors: readonly [
|
|
61
61
|
"warning",
|
|
62
|
-
"
|
|
62
|
+
"statusCompletedWithErrors"
|
|
63
63
|
];
|
|
64
64
|
readonly failed: readonly [
|
|
65
65
|
"danger",
|
|
66
|
-
"
|
|
66
|
+
"statusFailed"
|
|
67
67
|
];
|
|
68
68
|
};
|
|
69
69
|
export interface KjunExecutionStatusBadgeProps {
|
|
@@ -34,7 +34,9 @@ export * from "./list.cjs";
|
|
|
34
34
|
export * from "./app-navigation.cjs";
|
|
35
35
|
export * from "./media.cjs";
|
|
36
36
|
export * from "./chip.cjs";
|
|
37
|
+
export * from "./fab.cjs";
|
|
37
38
|
export * from "./range-input.cjs";
|
|
38
39
|
export * from "./quantity-stepper.cjs";
|
|
39
40
|
export * from "./time-picker.cjs";
|
|
40
41
|
export type { ShadowLayer, ElevationRole, CardElevation } from "@kjun-ui/tokens";
|
|
42
|
+
export { kjunMessagesKo, kjunMessagesEn, type KjunMessages } from "../../../shared/package-runtime/messages/index.cjs";
|
|
@@ -34,7 +34,9 @@ export * from "./list.js";
|
|
|
34
34
|
export * from "./app-navigation.js";
|
|
35
35
|
export * from "./media.js";
|
|
36
36
|
export * from "./chip.js";
|
|
37
|
+
export * from "./fab.js";
|
|
37
38
|
export * from "./range-input.js";
|
|
38
39
|
export * from "./quantity-stepper.js";
|
|
39
40
|
export * from "./time-picker.js";
|
|
40
41
|
export type { ShadowLayer, ElevationRole, CardElevation } from "@kjun-ui/tokens";
|
|
42
|
+
export { kjunMessagesKo, kjunMessagesEn, type KjunMessages } from "../../../shared/package-runtime/messages/index.js";
|
|
@@ -15,13 +15,15 @@ export interface KjunFormGroupProps {
|
|
|
15
15
|
label?: string;
|
|
16
16
|
id?: string;
|
|
17
17
|
required?: boolean;
|
|
18
|
+
/** Marks the field as optional with the "(선택)" / "(optional)" message; required wins when both are set. */
|
|
19
|
+
optional?: boolean;
|
|
18
20
|
error?: string;
|
|
19
21
|
hint?: string;
|
|
20
22
|
/** Hides the label visually while it still names the field. */
|
|
21
23
|
labelHidden?: boolean;
|
|
22
24
|
children: ReactNode;
|
|
23
25
|
}
|
|
24
|
-
export declare function KjunFormGroup({ label, id, required, error, hint, labelHidden, children, }: KjunFormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunFormGroup({ label, id, required, optional, error, hint, labelHidden, children, }: KjunFormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
export interface KjunInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "value" | "defaultValue"> {
|
|
26
28
|
size?: InputSize;
|
|
27
29
|
value: string | number;
|
|
@@ -15,13 +15,15 @@ export interface KjunFormGroupProps {
|
|
|
15
15
|
label?: string;
|
|
16
16
|
id?: string;
|
|
17
17
|
required?: boolean;
|
|
18
|
+
/** Marks the field as optional with the "(선택)" / "(optional)" message; required wins when both are set. */
|
|
19
|
+
optional?: boolean;
|
|
18
20
|
error?: string;
|
|
19
21
|
hint?: string;
|
|
20
22
|
/** Hides the label visually while it still names the field. */
|
|
21
23
|
labelHidden?: boolean;
|
|
22
24
|
children: ReactNode;
|
|
23
25
|
}
|
|
24
|
-
export declare function KjunFormGroup({ label, id, required, error, hint, labelHidden, children, }: KjunFormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunFormGroup({ label, id, required, optional, error, hint, labelHidden, children, }: KjunFormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
export interface KjunInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "value" | "defaultValue"> {
|
|
26
28
|
size?: InputSize;
|
|
27
29
|
value: string | number;
|
|
@@ -16,5 +16,9 @@ export interface KjunListSectionProps {
|
|
|
16
16
|
actions?: ReactNode;
|
|
17
17
|
children: ReactNode;
|
|
18
18
|
ariaLabel?: string;
|
|
19
|
+
/** Draws dividers between rows (default true). */
|
|
20
|
+
divider?: boolean;
|
|
21
|
+
/** "compact" rows keep the 16px inset but are 44 tall (the touch minimum) instead of 56. */
|
|
22
|
+
density?: "default" | "compact";
|
|
19
23
|
}
|
|
20
|
-
export declare function KjunListSection({ title, description, actions, children, ariaLabel }: KjunListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function KjunListSection({ title, description, actions, children, ariaLabel, divider, density }: KjunListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,5 +16,9 @@ export interface KjunListSectionProps {
|
|
|
16
16
|
actions?: ReactNode;
|
|
17
17
|
children: ReactNode;
|
|
18
18
|
ariaLabel?: string;
|
|
19
|
+
/** Draws dividers between rows (default true). */
|
|
20
|
+
divider?: boolean;
|
|
21
|
+
/** "compact" rows keep the 16px inset but are 44 tall (the touch minimum) instead of 56. */
|
|
22
|
+
density?: "default" | "compact";
|
|
19
23
|
}
|
|
20
|
-
export declare function KjunListSection({ title, description, actions, children, ariaLabel }: KjunListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function KjunListSection({ title, description, actions, children, ariaLabel, divider, density }: KjunListSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { type KjunMessages } from "../../../shared/package-runtime/messages/index.cjs";
|
|
1
2
|
import type { KjunIconRegistry } from "@kjun-ui/icons";
|
|
2
3
|
import { type HTMLAttributes, type ReactNode } from "react";
|
|
3
4
|
export declare const useKjunPortalContainer: () => HTMLElement | null | undefined;
|
|
4
5
|
export interface KjunProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
icons?: KjunIconRegistry;
|
|
8
|
+
/** BCP 47 tag (e.g. "en-US") for KJUN copy and Intl formats; without it KJUN stays Korean. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
/** Replaces part of KJUN's copy, e.g. with the app's own translations. */
|
|
11
|
+
messages?: Partial<KjunMessages>;
|
|
7
12
|
}
|
|
8
|
-
export declare function KjunProvider({ icons, children, className, ...props }: KjunProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function KjunProvider({ icons, locale, messages, children, className, ...props }: KjunProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { type KjunMessages } from "../../../shared/package-runtime/messages/index.js";
|
|
1
2
|
import type { KjunIconRegistry } from "@kjun-ui/icons";
|
|
2
3
|
import { type HTMLAttributes, type ReactNode } from "react";
|
|
3
4
|
export declare const useKjunPortalContainer: () => HTMLElement | null | undefined;
|
|
4
5
|
export interface KjunProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
icons?: KjunIconRegistry;
|
|
8
|
+
/** BCP 47 tag (e.g. "en-US") for KJUN copy and Intl formats; without it KJUN stays Korean. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
/** Replaces part of KJUN's copy, e.g. with the app's own translations. */
|
|
11
|
+
messages?: Partial<KjunMessages>;
|
|
7
12
|
}
|
|
8
|
-
export declare function KjunProvider({ icons, children, className, ...props }: KjunProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function KjunProvider({ icons, locale, messages, children, className, ...props }: KjunProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type KjunMessages } from "./messages/index.cjs";
|
|
1
2
|
import type { createFeedbackController, ConfirmOptions, FeedbackRequest, PromptOptions } from "@kjun-ui/tokens";
|
|
2
|
-
export declare function useFeedbackDialog(controller: ReturnType<typeof createFeedbackController>, request: FeedbackRequest): {
|
|
3
|
+
export declare function useFeedbackDialog(controller: ReturnType<typeof createFeedbackController>, request: FeedbackRequest, messages?: KjunMessages): {
|
|
3
4
|
options: PromptOptions & ConfirmOptions;
|
|
4
5
|
value: string;
|
|
5
6
|
error: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type KjunMessages } from "./messages/index.js";
|
|
1
2
|
import type { createFeedbackController, ConfirmOptions, FeedbackRequest, PromptOptions } from "@kjun-ui/tokens";
|
|
2
|
-
export declare function useFeedbackDialog(controller: ReturnType<typeof createFeedbackController>, request: FeedbackRequest): {
|
|
3
|
+
export declare function useFeedbackDialog(controller: ReturnType<typeof createFeedbackController>, request: FeedbackRequest, messages?: KjunMessages): {
|
|
3
4
|
options: PromptOptions & ConfirmOptions;
|
|
4
5
|
value: string;
|
|
5
6
|
error: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { kjunMessagesEn } from "./en.cjs";
|
|
2
|
+
import { kjunMessagesKo, type KjunMessages } from "./ko.cjs";
|
|
3
|
+
export { kjunMessagesEn, kjunMessagesKo, type KjunMessages };
|
|
4
|
+
/** What KjunProvider resolved: the copy to render and the locale handed to Intl (undefined keeps each call site's old default). */
|
|
5
|
+
export interface KjunMessageScope {
|
|
6
|
+
intl?: string;
|
|
7
|
+
language?: string;
|
|
8
|
+
messages: KjunMessages;
|
|
9
|
+
overrides: Partial<KjunMessages>;
|
|
10
|
+
}
|
|
11
|
+
export declare const defaultMessageScope: KjunMessageScope;
|
|
12
|
+
/** "en_US" becomes "en-US"; a tag Intl rejects keeps its language for the copy but no Intl locale, and never throws. */
|
|
13
|
+
export declare function normalizeLocale(locale?: string): {
|
|
14
|
+
intl?: string;
|
|
15
|
+
language?: string;
|
|
16
|
+
};
|
|
17
|
+
/** Props > messages > the locale's pack (ko, en, otherwise en) > Korean. A nested scope in another language drops the outer overrides. */
|
|
18
|
+
export declare function resolveMessageScope(parent: KjunMessageScope | undefined, locale?: string, messages?: Partial<KjunMessages>): KjunMessageScope;
|
|
19
|
+
export declare function formatRelativeTime(value: string | number | Date, now?: number, scope?: KjunMessageScope): string;
|
|
20
|
+
/** A "YYYY-MM-DD" value for display; without a locale it keeps KJUN's "2026. 10. 23." form. */
|
|
21
|
+
export declare function formatDateValue(iso: string, scope?: KjunMessageScope): string;
|
|
22
|
+
/** Calendar heading and Sunday-first weekday names; month is 0-based. */
|
|
23
|
+
export declare function calendarLabels(year: number, month: number, scope?: KjunMessageScope): {
|
|
24
|
+
title: string;
|
|
25
|
+
weekdays: string[];
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { kjunMessagesEn } from "./en.js";
|
|
2
|
+
import { kjunMessagesKo, type KjunMessages } from "./ko.js";
|
|
3
|
+
export { kjunMessagesEn, kjunMessagesKo, type KjunMessages };
|
|
4
|
+
/** What KjunProvider resolved: the copy to render and the locale handed to Intl (undefined keeps each call site's old default). */
|
|
5
|
+
export interface KjunMessageScope {
|
|
6
|
+
intl?: string;
|
|
7
|
+
language?: string;
|
|
8
|
+
messages: KjunMessages;
|
|
9
|
+
overrides: Partial<KjunMessages>;
|
|
10
|
+
}
|
|
11
|
+
export declare const defaultMessageScope: KjunMessageScope;
|
|
12
|
+
/** "en_US" becomes "en-US"; a tag Intl rejects keeps its language for the copy but no Intl locale, and never throws. */
|
|
13
|
+
export declare function normalizeLocale(locale?: string): {
|
|
14
|
+
intl?: string;
|
|
15
|
+
language?: string;
|
|
16
|
+
};
|
|
17
|
+
/** Props > messages > the locale's pack (ko, en, otherwise en) > Korean. A nested scope in another language drops the outer overrides. */
|
|
18
|
+
export declare function resolveMessageScope(parent: KjunMessageScope | undefined, locale?: string, messages?: Partial<KjunMessages>): KjunMessageScope;
|
|
19
|
+
export declare function formatRelativeTime(value: string | number | Date, now?: number, scope?: KjunMessageScope): string;
|
|
20
|
+
/** A "YYYY-MM-DD" value for display; without a locale it keeps KJUN's "2026. 10. 23." form. */
|
|
21
|
+
export declare function formatDateValue(iso: string, scope?: KjunMessageScope): string;
|
|
22
|
+
/** Calendar heading and Sunday-first weekday names; month is 0-based. */
|
|
23
|
+
export declare function calendarLabels(year: number, month: number, scope?: KjunMessageScope): {
|
|
24
|
+
title: string;
|
|
25
|
+
weekdays: string[];
|
|
26
|
+
};
|