@kjun-ui/react 0.9.0 → 0.10.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 +193 -34
- package/dist/index.js +239 -79
- package/dist/styles.css +30 -19
- 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/display.d.cts +4 -1
- package/dist/types/packages/react/src/display.d.ts +4 -1
- package/dist/types/packages/react/src/floating-panel.d.cts +3 -1
- package/dist/types/packages/react/src/floating-panel.d.ts +3 -1
- package/dist/types/packages/react/src/input.d.cts +5 -1
- package/dist/types/packages/react/src/input.d.ts +5 -1
- package/dist/types/packages/react/src/popover.d.cts +9 -2
- package/dist/types/packages/react/src/popover.d.ts +9 -2
- package/dist/types/packages/react/src/select-control.d.cts +5 -1
- package/dist/types/packages/react/src/select-control.d.ts +5 -1
- package/dist/types/shared/package-runtime/alert-live.d.cts +3 -0
- package/dist/types/shared/package-runtime/alert-live.d.ts +3 -0
- package/dist/types/shared/package-runtime/aria-ids.d.cts +4 -0
- package/dist/types/shared/package-runtime/aria-ids.d.ts +4 -0
- package/dist/types/shared/package-runtime/popover-nonmodal.d.cts +12 -0
- package/dist/types/shared/package-runtime/popover-nonmodal.d.ts +12 -0
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -250,6 +250,7 @@
|
|
|
250
250
|
--_kjun-extension-popover-radius: 12px;
|
|
251
251
|
--_kjun-extension-popover-padding: 16px;
|
|
252
252
|
--_kjun-extension-popover-gap: 12px;
|
|
253
|
+
--_kjun-extension-popover-header-padding-bottom: 12px;
|
|
253
254
|
--_kjun-extension-state-title-size: 1.25rem;
|
|
254
255
|
--_kjun-extension-state-description-size: 0.75rem;
|
|
255
256
|
--_kjun-extension-state-padding-sm: 24px;
|
|
@@ -946,28 +947,30 @@
|
|
|
946
947
|
/* Baseline for kjun-owned markup only: an element with a class that starts with kjun- (kjun- is reserved;
|
|
947
948
|
my-kjun-logo is app markup). Component roots carry a kjun- class (Vue adds kjun-root, the Vue layer host is kjun-layers);
|
|
948
949
|
portal roots pair kjun-scope with a kjun- class. The bare Provider root (kjun-scope) is excluded, so app markup inside the Provider keeps its own styles.
|
|
949
|
-
Slot content placed inside a kjun component follows this baseline; style it with classes.
|
|
950
|
+
Slot content placed inside a kjun component follows this baseline; style it with classes.
|
|
951
|
+
App markup under [data-kjun-content] opts out of the descendant resets, while kjun elements inside it get them back;
|
|
952
|
+
both branches keep the same specificity as before (the exclusion sits in :where). */
|
|
950
953
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]),
|
|
951
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) *,
|
|
954
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) *:not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) *,
|
|
952
955
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"])::before,
|
|
953
956
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"])::after,
|
|
954
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) *::before,
|
|
955
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) *::after {
|
|
957
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) *:not(:where([data-kjun-content] *))::before, .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) *::before,
|
|
958
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) *:not(:where([data-kjun-content] *))::after, .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) *::after {
|
|
956
959
|
box-sizing: border-box;
|
|
957
960
|
border-width: 0;
|
|
958
961
|
border-style: solid;
|
|
959
962
|
border-color: var(--_kjun-color-border);
|
|
960
963
|
}
|
|
961
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(h1, h2, h3, h4, h5, h6, p, blockquote, dl, dd, figure, pre),
|
|
964
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(h1, h2, h3, h4, h5, h6, p, blockquote, dl, dd, figure, pre):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(h1, h2, h3, h4, h5, h6, p, blockquote, dl, dd, figure, pre),
|
|
962
965
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(h1, h2, h3, h4, h5, h6, p, blockquote, dl, dd, figure, pre) {
|
|
963
966
|
margin: 0;
|
|
964
967
|
}
|
|
965
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(h1, h2, h3, h4, h5, h6),
|
|
968
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(h1, h2, h3, h4, h5, h6):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(h1, h2, h3, h4, h5, h6),
|
|
966
969
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(h1, h2, h3, h4, h5, h6) {
|
|
967
970
|
font-size: inherit;
|
|
968
971
|
font-weight: inherit;
|
|
969
972
|
}
|
|
970
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(button, input, optgroup, select, textarea),
|
|
973
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(button, input, optgroup, select, textarea):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(button, input, optgroup, select, textarea),
|
|
971
974
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(button, input, optgroup, select, textarea) {
|
|
972
975
|
font: inherit;
|
|
973
976
|
letter-spacing: inherit;
|
|
@@ -975,33 +978,33 @@
|
|
|
975
978
|
margin: 0;
|
|
976
979
|
padding: 0;
|
|
977
980
|
}
|
|
978
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(button, select),
|
|
981
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(button, select):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(button, select),
|
|
979
982
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(button, select) { text-transform: none; }
|
|
980
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(button, [type="button"], [type="reset"], [type="submit"]),
|
|
983
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(button, [type="button"], [type="reset"], [type="submit"]):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(button, [type="button"], [type="reset"], [type="submit"]),
|
|
981
984
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(button, [type="button"], [type="reset"], [type="submit"]) {
|
|
982
985
|
-webkit-appearance: button;
|
|
983
986
|
background-color: transparent;
|
|
984
987
|
background-image: none;
|
|
985
988
|
}
|
|
986
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(button, [role="button"]),
|
|
989
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(button, [role="button"]):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(button, [role="button"]),
|
|
987
990
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(button, [role="button"]) { cursor: pointer; }
|
|
988
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(:disabled),
|
|
991
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(:disabled):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(:disabled),
|
|
989
992
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(:disabled) { cursor: default; }
|
|
990
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(a),
|
|
993
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(a):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(a),
|
|
991
994
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(a) { color: inherit; text-decoration: inherit; }
|
|
992
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(ol, ul, menu),
|
|
995
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(ol, ul, menu):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(ol, ul, menu),
|
|
993
996
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(ol, ul, menu) { list-style: none; margin: 0; padding: 0; }
|
|
994
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(table),
|
|
997
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(table):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(table),
|
|
995
998
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(table) { text-indent: 0; border-color: inherit; border-collapse: collapse; }
|
|
996
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(fieldset, legend),
|
|
999
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(fieldset, legend):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(fieldset, legend),
|
|
997
1000
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(fieldset, legend) { margin: 0; padding: 0; }
|
|
998
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(textarea),
|
|
1001
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(textarea):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(textarea),
|
|
999
1002
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(textarea) { resize: vertical; }
|
|
1000
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(input, textarea)::placeholder,
|
|
1003
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(input, textarea):not(:where([data-kjun-content] *))::placeholder, .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(input, textarea)::placeholder,
|
|
1001
1004
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(input, textarea)::placeholder { opacity: 1; }
|
|
1002
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(img, video),
|
|
1005
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where(img, video):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where(img, video),
|
|
1003
1006
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where(img, video) { max-width: 100%; height: auto; }
|
|
1004
|
-
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where([hidden]:not([hidden="until-found"])),
|
|
1007
|
+
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]) :where([hidden]:not([hidden="until-found"])):not(:where([data-kjun-content] *)), .kjun-scope :where([data-kjun-content] :is([class^="kjun-"], [class*=" kjun-"])) :where([hidden]:not([hidden="until-found"])),
|
|
1005
1008
|
.kjun-scope :where(:is([class^="kjun-"], [class*=" kjun-"]):not(.kjun-scope), .kjun-scope[class*=" kjun-"]):where([hidden]:not([hidden="until-found"])) { display: none; }
|
|
1006
1009
|
/* Last so it wins over the element resets above (e.g. font: inherit on a root <button>).
|
|
1007
1010
|
The outermost kjun element takes the scope's text style; nested kjun elements inherit it.
|
|
@@ -1770,6 +1773,9 @@
|
|
|
1770
1773
|
justify-content: flex-end;
|
|
1771
1774
|
gap: var(--_kjun-geometry-modal-actions-gap);
|
|
1772
1775
|
}
|
|
1776
|
+
/* wrap: the inline height becomes a minimum (set by the component) and the label may break lines. */
|
|
1777
|
+
.kjun-button[data-wrap] { flex-shrink: 1; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; }
|
|
1778
|
+
.kjun-button[data-wrap] > .kjun-button-label { min-width: 0; }
|
|
1773
1779
|
.kjun-form-actions > .kjun-button {
|
|
1774
1780
|
--_kjun-action-height: var(--_kjun-geometry-button-heights-lg);
|
|
1775
1781
|
height: auto !important;
|
|
@@ -2424,6 +2430,11 @@
|
|
|
2424
2430
|
font-weight:var(--_kjun-type-body-weight); letter-spacing:var(--_kjun-type-body-tracking);
|
|
2425
2431
|
}
|
|
2426
2432
|
.kjun-popover-dialog { outline:none; }
|
|
2433
|
+
/* With a header only the body scrolls: the panel and dialog become clipping flex columns. */
|
|
2434
|
+
.kjun-popover-has-header { display:flex; flex-direction:column; overflow:hidden; }
|
|
2435
|
+
.kjun-popover-has-header .kjun-popover-dialog { display:flex; flex-direction:column; flex:1 1 auto; min-height:0; }
|
|
2436
|
+
.kjun-popover-header { flex:none; padding:var(--_kjun-extension-popover-padding) var(--_kjun-extension-popover-padding) var(--_kjun-extension-popover-header-padding-bottom); border-bottom:var(--_kjun-border-default-width) solid var(--_kjun-color-divider); font-size:var(--_kjun-type-card-title-size); line-height:var(--_kjun-type-card-title-line); font-weight:var(--_kjun-type-card-title-weight); letter-spacing:var(--_kjun-type-card-title-tracking); word-break:keep-all; overflow-wrap:anywhere; }
|
|
2437
|
+
.kjun-popover-body { flex:1 1 auto; min-height:0; overflow-y:auto; }
|
|
2427
2438
|
.kjun-popover-content { display:flex; flex-direction:column; gap:var(--_kjun-extension-popover-gap); padding:var(--_kjun-extension-popover-padding); min-width:0; word-break:keep-all; overflow-wrap:anywhere; }
|
|
2428
2439
|
.kjun-popover-content[data-no-padding="true"] { padding:0; gap:0; }
|
|
2429
2440
|
.kjun-tooltip {
|
|
@@ -13,6 +13,8 @@ export interface KjunButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonEle
|
|
|
13
13
|
size?: ButtonSize;
|
|
14
14
|
loading?: boolean;
|
|
15
15
|
block?: boolean;
|
|
16
|
+
/** Long labels wrap: the size's height becomes a minimum and the button grows instead of overflowing. */
|
|
17
|
+
wrap?: boolean;
|
|
16
18
|
prefixIcon?: string;
|
|
17
19
|
suffixIcon?: string;
|
|
18
20
|
prefixIconFilled?: boolean;
|
|
@@ -13,6 +13,8 @@ export interface KjunButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonEle
|
|
|
13
13
|
size?: ButtonSize;
|
|
14
14
|
loading?: boolean;
|
|
15
15
|
block?: boolean;
|
|
16
|
+
/** Long labels wrap: the size's height becomes a minimum and the button grows instead of overflowing. */
|
|
17
|
+
wrap?: boolean;
|
|
16
18
|
prefixIcon?: string;
|
|
17
19
|
suffixIcon?: string;
|
|
18
20
|
prefixIconFilled?: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AlertLive } from "../../../shared/package-runtime/alert-live.cjs";
|
|
1
2
|
import { type CSSProperties, type HTMLAttributes, type ReactNode } from "react";
|
|
2
3
|
export type DisplaySize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
3
4
|
export type SemanticTone = "primary" | "success" | "warning" | "danger" | "info";
|
|
@@ -27,12 +28,14 @@ export interface KjunAlertProps {
|
|
|
27
28
|
size?: "sm" | "md" | "lg";
|
|
28
29
|
title?: ReactNode;
|
|
29
30
|
closable?: boolean;
|
|
31
|
+
/** How screen readers announce it: assertive (role alert), polite (status) or off; defaults to alert for danger, status otherwise. */
|
|
32
|
+
live?: AlertLive;
|
|
30
33
|
children?: ReactNode;
|
|
31
34
|
/** Buttons placed under the message; unsized KjunButtons follow the alert size. */
|
|
32
35
|
actions?: ReactNode;
|
|
33
36
|
onClose?: () => void;
|
|
34
37
|
}
|
|
35
|
-
export declare function KjunAlert({ type, variant, size, title, closable, children, actions, onClose, }: KjunAlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
38
|
+
export declare function KjunAlert({ type, variant, size, title, closable, live, children, actions, onClose, }: KjunAlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
36
39
|
export interface KjunProgressProps {
|
|
37
40
|
value?: number;
|
|
38
41
|
max?: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type AlertLive } from "../../../shared/package-runtime/alert-live.js";
|
|
1
2
|
import { type CSSProperties, type HTMLAttributes, type ReactNode } from "react";
|
|
2
3
|
export type DisplaySize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
3
4
|
export type SemanticTone = "primary" | "success" | "warning" | "danger" | "info";
|
|
@@ -27,12 +28,14 @@ export interface KjunAlertProps {
|
|
|
27
28
|
size?: "sm" | "md" | "lg";
|
|
28
29
|
title?: ReactNode;
|
|
29
30
|
closable?: boolean;
|
|
31
|
+
/** How screen readers announce it: assertive (role alert), polite (status) or off; defaults to alert for danger, status otherwise. */
|
|
32
|
+
live?: AlertLive;
|
|
30
33
|
children?: ReactNode;
|
|
31
34
|
/** Buttons placed under the message; unsized KjunButtons follow the alert size. */
|
|
32
35
|
actions?: ReactNode;
|
|
33
36
|
onClose?: () => void;
|
|
34
37
|
}
|
|
35
|
-
export declare function KjunAlert({ type, variant, size, title, closable, children, actions, onClose, }: KjunAlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
38
|
+
export declare function KjunAlert({ type, variant, size, title, closable, live, children, actions, onClose, }: KjunAlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
36
39
|
export interface KjunProgressProps {
|
|
37
40
|
value?: number;
|
|
38
41
|
max?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode, type RefObject } from "react";
|
|
2
2
|
export type Placement = "top" | "bottom" | "left" | "right" | "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
3
|
-
export declare function FloatingPanel({ open, onOpenChange, triggerRef, children, placement, className, matchTriggerWidth, maxHeight, field, flip, nonModal, returnFocus, }: {
|
|
3
|
+
export declare function FloatingPanel({ open, onOpenChange, triggerRef, children, placement, className, matchTriggerWidth, maxHeight, field, flip, nonModal, ownsDismiss, returnFocus, }: {
|
|
4
4
|
open: boolean;
|
|
5
5
|
onOpenChange: (v: boolean) => void;
|
|
6
6
|
triggerRef: RefObject<HTMLElement | null>;
|
|
@@ -12,5 +12,7 @@ export declare function FloatingPanel({ open, onOpenChange, triggerRef, children
|
|
|
12
12
|
field?: boolean;
|
|
13
13
|
flip?: boolean;
|
|
14
14
|
nonModal?: boolean;
|
|
15
|
+
/** The consumer closes the panel itself (non-modal Popover); ignore react-aria's own close requests. */
|
|
16
|
+
ownsDismiss?: boolean;
|
|
15
17
|
returnFocus?: () => HTMLElement | null | false | undefined;
|
|
16
18
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode, type RefObject } from "react";
|
|
2
2
|
export type Placement = "top" | "bottom" | "left" | "right" | "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
3
|
-
export declare function FloatingPanel({ open, onOpenChange, triggerRef, children, placement, className, matchTriggerWidth, maxHeight, field, flip, nonModal, returnFocus, }: {
|
|
3
|
+
export declare function FloatingPanel({ open, onOpenChange, triggerRef, children, placement, className, matchTriggerWidth, maxHeight, field, flip, nonModal, ownsDismiss, returnFocus, }: {
|
|
4
4
|
open: boolean;
|
|
5
5
|
onOpenChange: (v: boolean) => void;
|
|
6
6
|
triggerRef: RefObject<HTMLElement | null>;
|
|
@@ -12,5 +12,7 @@ export declare function FloatingPanel({ open, onOpenChange, triggerRef, children
|
|
|
12
12
|
field?: boolean;
|
|
13
13
|
flip?: boolean;
|
|
14
14
|
nonModal?: boolean;
|
|
15
|
+
/** The consumer closes the panel itself (non-modal Popover); ignore react-aria's own close requests. */
|
|
16
|
+
ownsDismiss?: boolean;
|
|
15
17
|
returnFocus?: () => HTMLElement | null | false | undefined;
|
|
16
18
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,6 +6,8 @@ interface FieldContextValue {
|
|
|
6
6
|
describedBy?: string;
|
|
7
7
|
error?: string;
|
|
8
8
|
required?: boolean;
|
|
9
|
+
/** A control with its own id registers it so the group label points at it. */
|
|
10
|
+
setControlId?: (id: string | undefined) => void;
|
|
9
11
|
}
|
|
10
12
|
export declare const FieldContext: import("react").Context<FieldContextValue | null>;
|
|
11
13
|
export declare const useKjunField: () => FieldContextValue | null;
|
|
@@ -15,9 +17,11 @@ export interface KjunFormGroupProps {
|
|
|
15
17
|
required?: boolean;
|
|
16
18
|
error?: string;
|
|
17
19
|
hint?: string;
|
|
20
|
+
/** Hides the label visually while it still names the field. */
|
|
21
|
+
labelHidden?: boolean;
|
|
18
22
|
children: ReactNode;
|
|
19
23
|
}
|
|
20
|
-
export declare function KjunFormGroup({ label, id, required, error, hint, children, }: KjunFormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function KjunFormGroup({ label, id, required, error, hint, labelHidden, children, }: KjunFormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
21
25
|
export interface KjunInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "value" | "defaultValue"> {
|
|
22
26
|
size?: InputSize;
|
|
23
27
|
value: string | number;
|
|
@@ -6,6 +6,8 @@ interface FieldContextValue {
|
|
|
6
6
|
describedBy?: string;
|
|
7
7
|
error?: string;
|
|
8
8
|
required?: boolean;
|
|
9
|
+
/** A control with its own id registers it so the group label points at it. */
|
|
10
|
+
setControlId?: (id: string | undefined) => void;
|
|
9
11
|
}
|
|
10
12
|
export declare const FieldContext: import("react").Context<FieldContextValue | null>;
|
|
11
13
|
export declare const useKjunField: () => FieldContextValue | null;
|
|
@@ -15,9 +17,11 @@ export interface KjunFormGroupProps {
|
|
|
15
17
|
required?: boolean;
|
|
16
18
|
error?: string;
|
|
17
19
|
hint?: string;
|
|
20
|
+
/** Hides the label visually while it still names the field. */
|
|
21
|
+
labelHidden?: boolean;
|
|
18
22
|
children: ReactNode;
|
|
19
23
|
}
|
|
20
|
-
export declare function KjunFormGroup({ label, id, required, error, hint, children, }: KjunFormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function KjunFormGroup({ label, id, required, error, hint, labelHidden, children, }: KjunFormGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
21
25
|
export interface KjunInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "value" | "defaultValue"> {
|
|
22
26
|
size?: InputSize;
|
|
23
27
|
value: string | number;
|
|
@@ -12,14 +12,21 @@ export interface KjunPopoverProps {
|
|
|
12
12
|
placement?: "top" | "bottom" | "left" | "right";
|
|
13
13
|
/** Where focus goes when the Popover closes. Defaults to the trigger, also when the target is gone. */
|
|
14
14
|
returnFocus?: HTMLElement | RefObject<HTMLElement | null> | (() => HTMLElement | null);
|
|
15
|
+
/** Fixed header above the body; only the body scrolls and maxHeight covers both. Names the dialog without ariaLabel. */
|
|
16
|
+
header?: ReactNode;
|
|
17
|
+
/** false keeps the page usable: Tab can leave, and an outside press or focus move closes without returning focus. */
|
|
18
|
+
modal?: boolean;
|
|
15
19
|
trigger: ReactNode | ((open: boolean) => ReactNode);
|
|
16
20
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
17
21
|
}
|
|
18
|
-
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, header, modal, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
19
23
|
export interface KjunTooltipProps {
|
|
20
24
|
content?: string;
|
|
21
25
|
placement?: "top" | "bottom" | "left" | "right";
|
|
22
26
|
delay?: number;
|
|
27
|
+
/** Controlled visibility; omit to let hover and focus drive it. */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
30
|
children: ReactNode;
|
|
24
31
|
}
|
|
25
|
-
export declare function KjunTooltip({ content, placement, delay, children, }: KjunTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function KjunTooltip({ content, placement, delay, open: controlled, onOpenChange, children, }: KjunTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,14 +12,21 @@ export interface KjunPopoverProps {
|
|
|
12
12
|
placement?: "top" | "bottom" | "left" | "right";
|
|
13
13
|
/** Where focus goes when the Popover closes. Defaults to the trigger, also when the target is gone. */
|
|
14
14
|
returnFocus?: HTMLElement | RefObject<HTMLElement | null> | (() => HTMLElement | null);
|
|
15
|
+
/** Fixed header above the body; only the body scrolls and maxHeight covers both. Names the dialog without ariaLabel. */
|
|
16
|
+
header?: ReactNode;
|
|
17
|
+
/** false keeps the page usable: Tab can leave, and an outside press or focus move closes without returning focus. */
|
|
18
|
+
modal?: boolean;
|
|
15
19
|
trigger: ReactNode | ((open: boolean) => ReactNode);
|
|
16
20
|
children: ReactNode | ((close: () => void) => ReactNode);
|
|
17
21
|
}
|
|
18
|
-
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function KjunPopover({ noPadding, open: controlled, onOpenChange, manualTrigger, matchTriggerWidth, maxHeight, flip, focusOnOpen, ariaLabel, placement, returnFocus, header, modal, trigger, children, }: KjunPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
19
23
|
export interface KjunTooltipProps {
|
|
20
24
|
content?: string;
|
|
21
25
|
placement?: "top" | "bottom" | "left" | "right";
|
|
22
26
|
delay?: number;
|
|
27
|
+
/** Controlled visibility; omit to let hover and focus drive it. */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
30
|
children: ReactNode;
|
|
24
31
|
}
|
|
25
|
-
export declare function KjunTooltip({ content, placement, delay, children, }: KjunTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function KjunTooltip({ content, placement, delay, open: controlled, onOpenChange, children, }: KjunTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,10 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
ariaLabel?: string;
|
|
9
9
|
labelKey?: string;
|
|
10
|
+
/** Trigger id for an outside <label for>; defaults to the FormGroup's id. */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Extra description ids, merged with the FormGroup's hint and error. */
|
|
13
|
+
ariaDescribedBy?: string;
|
|
10
14
|
valueKey?: string;
|
|
11
15
|
size?: InputSize;
|
|
12
16
|
disabled?: boolean;
|
|
@@ -31,4 +35,4 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
31
35
|
searchKeys?: string[];
|
|
32
36
|
onClear?: () => void;
|
|
33
37
|
}
|
|
34
|
-
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, size, disabled, searchable, open: controlled, loading, searchPlaceholder, optionPageSize, clearable, multiple, error, menuHeader, renderOption, renderSelected, onValueChange, onChange, onOpenChange, onSearch, onClear, filterFn, searchKeys, }: KjunSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, id: triggerId, ariaDescribedBy, valueKey, size, disabled, searchable, open: controlled, loading, searchPlaceholder, optionPageSize, clearable, multiple, error, menuHeader, renderOption, renderSelected, onValueChange, onChange, onOpenChange, onSearch, onClear, filterFn, searchKeys, }: KjunSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,10 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
7
7
|
placeholder?: string;
|
|
8
8
|
ariaLabel?: string;
|
|
9
9
|
labelKey?: string;
|
|
10
|
+
/** Trigger id for an outside <label for>; defaults to the FormGroup's id. */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Extra description ids, merged with the FormGroup's hint and error. */
|
|
13
|
+
ariaDescribedBy?: string;
|
|
10
14
|
valueKey?: string;
|
|
11
15
|
size?: InputSize;
|
|
12
16
|
disabled?: boolean;
|
|
@@ -31,4 +35,4 @@ export interface KjunSelectProps<T extends SelectOption = SelectOption> {
|
|
|
31
35
|
searchKeys?: string[];
|
|
32
36
|
onClear?: () => void;
|
|
33
37
|
}
|
|
34
|
-
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, valueKey, size, disabled, searchable, open: controlled, loading, searchPlaceholder, optionPageSize, clearable, multiple, error, menuHeader, renderOption, renderSelected, onValueChange, onChange, onOpenChange, onSearch, onClear, filterFn, searchKeys, }: KjunSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function KjunSelect<T extends SelectOption = SelectOption>({ value, options, placeholder, ariaLabel, labelKey, id: triggerId, ariaDescribedBy, valueKey, size, disabled, searchable, open: controlled, loading, searchPlaceholder, optionPageSize, clearable, multiple, error, menuHeader, renderOption, renderSelected, onValueChange, onChange, onOpenChange, onSearch, onClear, filterFn, searchKeys, }: KjunSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type AlertLive = "assertive" | "polite" | "off";
|
|
2
|
+
/** Alert announcement role: `live` overrides the tone default (danger interrupts, others are polite); off announces nothing. */
|
|
3
|
+
export declare function alertRole(tone: string, live?: AlertLive): "alert" | "status" | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type AlertLive = "assertive" | "polite" | "off";
|
|
2
|
+
/** Alert announcement role: `live` overrides the tone default (danger interrupts, others are polite); off announces nothing. */
|
|
3
|
+
export declare function alertRole(tone: string, live?: AlertLive): "alert" | "status" | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Joins space-separated id lists, keeping each id once; empty input gives undefined so the attribute is omitted. */
|
|
2
|
+
export declare function mergeIds(...lists: (string | null | undefined)[]): string | undefined;
|
|
3
|
+
/** Joins hint and error text for platforms that announce one accessibility hint string. */
|
|
4
|
+
export declare function joinHints(...parts: (string | null | undefined)[]): string | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Joins space-separated id lists, keeping each id once; empty input gives undefined so the attribute is omitted. */
|
|
2
|
+
export declare function mergeIds(...lists: (string | null | undefined)[]): string | undefined;
|
|
3
|
+
/** Joins hint and error text for platforms that announce one accessibility hint string. */
|
|
4
|
+
export declare function joinHints(...parts: (string | null | undefined)[]): string | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The first tabbable element after the trigger in document order, outside the trigger and the skipped panel. */
|
|
2
|
+
export declare function nextTabbableAfter(trigger: HTMLElement, skip: HTMLElement | null): HTMLElement | null;
|
|
3
|
+
/**
|
|
4
|
+
* While open: Shift+Tab from the first element goes to the trigger, Tab from the last closes and moves on
|
|
5
|
+
* after the trigger, and focus or a press outside the panel, the trigger and other KJUN floating panels
|
|
6
|
+
* (menus opened from inside) closes it. Returns the cleanup.
|
|
7
|
+
*/
|
|
8
|
+
export declare function installNonModalPopover({ panel, trigger, close }: {
|
|
9
|
+
panel: () => HTMLElement | null;
|
|
10
|
+
trigger: () => HTMLElement | null;
|
|
11
|
+
close: () => void;
|
|
12
|
+
}): () => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The first tabbable element after the trigger in document order, outside the trigger and the skipped panel. */
|
|
2
|
+
export declare function nextTabbableAfter(trigger: HTMLElement, skip: HTMLElement | null): HTMLElement | null;
|
|
3
|
+
/**
|
|
4
|
+
* While open: Shift+Tab from the first element goes to the trigger, Tab from the last closes and moves on
|
|
5
|
+
* after the trigger, and focus or a press outside the panel, the trigger and other KJUN floating panels
|
|
6
|
+
* (menus opened from inside) closes it. Returns the cleanup.
|
|
7
|
+
*/
|
|
8
|
+
export declare function installNonModalPopover({ panel, trigger, close }: {
|
|
9
|
+
panel: () => HTMLElement | null;
|
|
10
|
+
trigger: () => HTMLElement | null;
|
|
11
|
+
close: () => void;
|
|
12
|
+
}): () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kjun-ui/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://ui.kjun.dev",
|
|
6
6
|
"repository": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"./package.json": "./package.json"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@kjun-ui/tokens": "0.
|
|
44
|
+
"@kjun-ui/tokens": "0.10.0",
|
|
45
45
|
"react-aria-components": "1.21.1",
|
|
46
|
-
"@kjun-ui/icons": "0.
|
|
46
|
+
"@kjun-ui/icons": "0.10.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": "^19.2.3",
|