@kjun-ui/native 0.10.0 → 0.12.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 +1663 -1518
- package/dist/index.js +1335 -1190
- package/dist/index.web.cjs +1676 -1531
- package/dist/index.web.js +1339 -1194
- package/dist/styles.css +98 -0
- package/dist/types/packages/native/src/drawer.d.cts +9 -1
- package/dist/types/packages/native/src/drawer.d.ts +9 -1
- package/dist/types/packages/native/src/feedback.d.cts +5 -2
- package/dist/types/packages/native/src/feedback.d.ts +5 -2
- package/dist/types/packages/native/src/index.d.cts +1 -0
- package/dist/types/packages/native/src/index.d.ts +1 -0
- package/dist/types/packages/native/src/layout-primitives.d.cts +35 -0
- package/dist/types/packages/native/src/layout-primitives.d.ts +35 -0
- package/dist/types/shared/package-runtime/drawer-geometry.d.cts +36 -0
- package/dist/types/shared/package-runtime/drawer-geometry.d.ts +36 -0
- package/dist/types/shared/package-runtime/layout-primitives.d.cts +15 -0
- package/dist/types/shared/package-runtime/layout-primitives.d.ts +15 -0
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -417,6 +417,7 @@
|
|
|
417
417
|
--_kjun-extension-drawer-bottom-radius: 16px;
|
|
418
418
|
--_kjun-extension-drawer-radius: 0px;
|
|
419
419
|
--_kjun-extension-drawer-close-radius: 8px;
|
|
420
|
+
--_kjun-extension-drawer-sheet-gap: 48px;
|
|
420
421
|
--_kjun-extension-drawer-width: 400px;
|
|
421
422
|
--_kjun-extension-drawer-close-size: 32px;
|
|
422
423
|
--_kjun-extension-drawer-close-icon-size: 16px;
|
|
@@ -2559,6 +2560,19 @@
|
|
|
2559
2560
|
flex-direction: column;
|
|
2560
2561
|
outline: none;
|
|
2561
2562
|
}
|
|
2563
|
+
/* Safe areas arrive as --_kjun-drawer-safe-top/bottom on the overlay; the panel surface extends under them. */
|
|
2564
|
+
.kjun-drawer-overlay:not([data-position="bottom"]) .kjun-drawer-dialog { padding-top: var(--_kjun-drawer-safe-top); }
|
|
2565
|
+
.kjun-drawer-overlay:not([data-position="top"]) .kjun-drawer-dialog { padding-bottom: var(--_kjun-drawer-safe-bottom); }
|
|
2566
|
+
/* Top and bottom sheets stop short of the opposite edge (its safe area plus the sheet gap); only the body scrolls. */
|
|
2567
|
+
.kjun-drawer-overlay[data-position="bottom"] {
|
|
2568
|
+
--_kjun-drawer-sheet-max: calc(100dvh - var(--_kjun-drawer-safe-top) - var(--_kjun-extension-drawer-sheet-gap));
|
|
2569
|
+
}
|
|
2570
|
+
.kjun-drawer-overlay[data-position="top"] {
|
|
2571
|
+
--_kjun-drawer-sheet-max: calc(100dvh - var(--_kjun-drawer-safe-bottom) - var(--_kjun-extension-drawer-sheet-gap));
|
|
2572
|
+
}
|
|
2573
|
+
.kjun-drawer-overlay:is([data-position="top"], [data-position="bottom"]) :is(.kjun-drawer, .kjun-drawer-dialog) {
|
|
2574
|
+
max-height: var(--_kjun-drawer-max-height, var(--_kjun-drawer-sheet-max));
|
|
2575
|
+
}
|
|
2562
2576
|
.kjun-drawer-header {
|
|
2563
2577
|
display: flex;
|
|
2564
2578
|
align-items: center;
|
|
@@ -4393,6 +4407,8 @@
|
|
|
4393
4407
|
.kjun-kpi-row__value {
|
|
4394
4408
|
white-space: normal;
|
|
4395
4409
|
overflow-wrap: anywhere;
|
|
4410
|
+
/* Korean labels and values wrap at spaces, not between syllables; anywhere stays the last resort. */
|
|
4411
|
+
word-break: keep-all;
|
|
4396
4412
|
}
|
|
4397
4413
|
.kjun-kpi-row--mobile-summary
|
|
4398
4414
|
.kjun-kpi-row__item--secondary
|
|
@@ -5090,3 +5106,85 @@
|
|
|
5090
5106
|
font-family: var(--kjun-font);
|
|
5091
5107
|
font-variant-numeric: normal;
|
|
5092
5108
|
}
|
|
5109
|
+
|
|
5110
|
+
/* KjunText, KjunStack, KjunInline: 글자 역할과 간격 단계를 이름으로만 고른다. 값은 모두 기존 토큰이다. */
|
|
5111
|
+
|
|
5112
|
+
/* KjunText: 크기·줄높이·굵기는 .kjun-type-* 역할이 정한다. 앱의 h1·p 요소 규칙이 들어오지 않도록
|
|
5113
|
+
여백·색·글꼴을 명시하고, 색과 글꼴은 부모(브랜드 카드 등)를 따른다. 클래스를 두 번 써서 앱의
|
|
5114
|
+
`.prose p` 같은 규칙(0,1,1)보다 강하게 하되, .kjun-scope 밖(포털 등)에서도 그대로 적용된다. */
|
|
5115
|
+
.kjun-text.kjun-text {
|
|
5116
|
+
margin: 0;
|
|
5117
|
+
color: inherit;
|
|
5118
|
+
font-family: inherit;
|
|
5119
|
+
overflow-wrap: anywhere;
|
|
5120
|
+
}
|
|
5121
|
+
.kjun-text.kjun-type-number-sm,
|
|
5122
|
+
.kjun-text.kjun-type-number-md,
|
|
5123
|
+
.kjun-text.kjun-type-number-lg,
|
|
5124
|
+
.kjun-text.kjun-type-display-sm,
|
|
5125
|
+
.kjun-text.kjun-type-display-md,
|
|
5126
|
+
.kjun-text.kjun-type-display-lg {
|
|
5127
|
+
font-family: var(--_kjun-font-numeric);
|
|
5128
|
+
}
|
|
5129
|
+
/* 숫자는 자릿수 사이에서 끊지 않는다. display 크기는 휴대폰 폭을 넘지 않도록 기본 규칙(anywhere)을 둔다. */
|
|
5130
|
+
.kjun-text.kjun-type-number-sm,
|
|
5131
|
+
.kjun-text.kjun-type-number-md,
|
|
5132
|
+
.kjun-text.kjun-type-number-lg { overflow-wrap: normal; }
|
|
5133
|
+
.kjun-text.kjun-text[data-tone="secondary"] { color: var(--_kjun-color-text-secondary); }
|
|
5134
|
+
.kjun-text.kjun-text[data-tone="tertiary"] { color: var(--_kjun-color-text-tertiary); }
|
|
5135
|
+
.kjun-text.kjun-text[data-tone="disabled"] { color: var(--_kjun-color-text-disabled); }
|
|
5136
|
+
.kjun-text[data-align="start"] { text-align: start; }
|
|
5137
|
+
.kjun-text[data-align="center"] { text-align: center; }
|
|
5138
|
+
.kjun-text[data-align="end"] { text-align: end; }
|
|
5139
|
+
.kjun-text[data-max-lines] {
|
|
5140
|
+
display: -webkit-box;
|
|
5141
|
+
-webkit-box-orient: vertical;
|
|
5142
|
+
-webkit-line-clamp: var(--_kjun-text-lines);
|
|
5143
|
+
overflow: hidden;
|
|
5144
|
+
}
|
|
5145
|
+
|
|
5146
|
+
/* KjunStack: 세로 쌓기. 간격은 space.stack·space.section 단계다.
|
|
5147
|
+
클래스 대신 data 속성을 써서 KJUN 마크업으로 판정되지 않는다. 그래서 안에 넣은 앱 요소는 Stack이
|
|
5148
|
+
없을 때와 같은 스타일을 받고, Stack을 몇 겹 겹쳐도 달라지지 않는다. */
|
|
5149
|
+
[data-kjun-stack] {
|
|
5150
|
+
display: flex;
|
|
5151
|
+
flex-direction: column;
|
|
5152
|
+
align-items: stretch;
|
|
5153
|
+
gap: var(--_kjun-geometry-space-stack-md);
|
|
5154
|
+
min-width: 0;
|
|
5155
|
+
}
|
|
5156
|
+
[data-kjun-stack][data-gap="none"] { gap: 0; }
|
|
5157
|
+
[data-kjun-stack][data-gap="sm"] { gap: var(--_kjun-geometry-space-stack-sm); }
|
|
5158
|
+
[data-kjun-stack][data-gap="lg"] { gap: var(--_kjun-geometry-space-stack-lg); }
|
|
5159
|
+
[data-kjun-stack][data-gap="section-sm"] { gap: var(--_kjun-geometry-space-section-sm); }
|
|
5160
|
+
[data-kjun-stack][data-gap="section-md"] { gap: var(--_kjun-geometry-space-section-md); }
|
|
5161
|
+
[data-kjun-stack][data-gap="section-lg"] { gap: var(--_kjun-geometry-space-section-lg); }
|
|
5162
|
+
[data-kjun-stack][data-align="start"] { align-items: flex-start; }
|
|
5163
|
+
[data-kjun-stack][data-align="center"] { align-items: center; }
|
|
5164
|
+
[data-kjun-stack][data-align="end"] { align-items: flex-end; }
|
|
5165
|
+
|
|
5166
|
+
/* KjunInline: 가로 배치. 간격은 space.inline 단계이고, 좁은 화면에서는 기본으로 줄바꿈한다. */
|
|
5167
|
+
[data-kjun-inline] {
|
|
5168
|
+
display: flex;
|
|
5169
|
+
flex-direction: row;
|
|
5170
|
+
flex-wrap: wrap;
|
|
5171
|
+
align-items: center;
|
|
5172
|
+
justify-content: flex-start;
|
|
5173
|
+
gap: var(--_kjun-geometry-space-inline-sm);
|
|
5174
|
+
min-width: 0;
|
|
5175
|
+
}
|
|
5176
|
+
[data-kjun-inline][data-wrap="false"] { flex-wrap: nowrap; }
|
|
5177
|
+
[data-kjun-inline][data-gap="none"] { gap: 0; }
|
|
5178
|
+
[data-kjun-inline][data-gap="xs"] { gap: var(--_kjun-geometry-space-inline-xs); }
|
|
5179
|
+
[data-kjun-inline][data-gap="md"] { gap: var(--_kjun-geometry-space-inline-md); }
|
|
5180
|
+
[data-kjun-inline][data-gap="lg"] { gap: var(--_kjun-geometry-space-inline-lg); }
|
|
5181
|
+
[data-kjun-inline][data-align="start"] { align-items: flex-start; }
|
|
5182
|
+
[data-kjun-inline][data-align="end"] { align-items: flex-end; }
|
|
5183
|
+
[data-kjun-inline][data-align="baseline"] { align-items: baseline; }
|
|
5184
|
+
[data-kjun-inline][data-align="stretch"] { align-items: stretch; }
|
|
5185
|
+
[data-kjun-inline][data-justify="center"] { justify-content: center; }
|
|
5186
|
+
[data-kjun-inline][data-justify="end"] { justify-content: flex-end; }
|
|
5187
|
+
[data-kjun-inline][data-justify="between"] { justify-content: space-between; }
|
|
5188
|
+
|
|
5189
|
+
/* 직계 폼 그룹은 자체 아래 여백 대신 부모 gap만 따른다. */
|
|
5190
|
+
:is([data-kjun-stack], [data-kjun-inline]) > .kjun-form-group { margin-bottom: 0; }
|
|
@@ -14,5 +14,13 @@ export interface KjunDrawerProps {
|
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
onClose?: () => void;
|
|
16
16
|
ariaLabel?: string;
|
|
17
|
+
/** Top safe area, padded inside top and side drawers and kept clear above a bottom sheet. */
|
|
18
|
+
safeAreaTop?: number;
|
|
19
|
+
/** Bottom safe area, padded inside bottom and side drawers and kept clear below a top sheet. */
|
|
20
|
+
safeAreaBottom?: number;
|
|
21
|
+
/** Height limit for top and bottom drawers; by default they stop a sheet gap short of the opposite edge. */
|
|
22
|
+
maxHeight?: number;
|
|
23
|
+
/** Keeps the panel above the on-screen keyboard (devices only). */
|
|
24
|
+
avoidKeyboard?: boolean;
|
|
17
25
|
}
|
|
18
|
-
export declare function KjunDrawer({ open, onOpenChange, title, position, width, closable, closeOnOverlay, closeOnEsc, noPadding, header, footer, children, onClose, ariaLabel, }: KjunDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunDrawer({ open, onOpenChange, title, position, width, closable, closeOnOverlay, closeOnEsc, noPadding, header, footer, children, onClose, ariaLabel, safeAreaTop, safeAreaBottom, maxHeight, avoidKeyboard, }: KjunDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,5 +14,13 @@ export interface KjunDrawerProps {
|
|
|
14
14
|
children: ReactNode;
|
|
15
15
|
onClose?: () => void;
|
|
16
16
|
ariaLabel?: string;
|
|
17
|
+
/** Top safe area, padded inside top and side drawers and kept clear above a bottom sheet. */
|
|
18
|
+
safeAreaTop?: number;
|
|
19
|
+
/** Bottom safe area, padded inside bottom and side drawers and kept clear below a top sheet. */
|
|
20
|
+
safeAreaBottom?: number;
|
|
21
|
+
/** Height limit for top and bottom drawers; by default they stop a sheet gap short of the opposite edge. */
|
|
22
|
+
maxHeight?: number;
|
|
23
|
+
/** Keeps the panel above the on-screen keyboard (devices only). */
|
|
24
|
+
avoidKeyboard?: boolean;
|
|
17
25
|
}
|
|
18
|
-
export declare function KjunDrawer({ open, onOpenChange, title, position, width, closable, closeOnOverlay, closeOnEsc, noPadding, header, footer, children, onClose, ariaLabel, }: KjunDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function KjunDrawer({ open, onOpenChange, title, position, width, closable, closeOnOverlay, closeOnEsc, noPadding, header, footer, children, onClose, ariaLabel, safeAreaTop, safeAreaBottom, maxHeight, avoidKeyboard, }: KjunDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { type KjunFeedback } from "@kjun-ui/tokens";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
4
|
export declare function useKjunFeedback(): KjunFeedback;
|
|
4
|
-
export
|
|
5
|
+
export interface KjunFeedbackProviderProps {
|
|
5
6
|
children: ReactNode;
|
|
6
|
-
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
}
|
|
9
|
+
export declare function KjunFeedbackProvider({ children, style }: KjunFeedbackProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export type { ConfirmOptions, KjunFeedback, PromptOptions, ToastOptions } from "@kjun-ui/tokens";
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { type KjunFeedback } from "@kjun-ui/tokens";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
4
|
export declare function useKjunFeedback(): KjunFeedback;
|
|
4
|
-
export
|
|
5
|
+
export interface KjunFeedbackProviderProps {
|
|
5
6
|
children: ReactNode;
|
|
6
|
-
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
}
|
|
9
|
+
export declare function KjunFeedbackProvider({ children, style }: KjunFeedbackProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export type { ConfirmOptions, KjunFeedback, PromptOptions, ToastOptions } from "@kjun-ui/tokens";
|
|
@@ -9,6 +9,7 @@ export { KjunModal, KjunFormActions } from "./modal.cjs";
|
|
|
9
9
|
export type { KjunModalProps, KjunFormActionsProps } from "./modal.cjs";
|
|
10
10
|
export type { KjunColors, KjunDomainColors, ColorRole, DomainColorRole, ButtonSize, InputSize, ButtonVariant, } from "@kjun-ui/tokens";
|
|
11
11
|
export * from "./display.cjs";
|
|
12
|
+
export * from "./layout-primitives.cjs";
|
|
12
13
|
export * from "./feedback.cjs";
|
|
13
14
|
export * from "./controls.cjs";
|
|
14
15
|
export { KjunPopover, KjunTooltip, KjunDropdown, KjunDropdownItem, KjunDropdownDivider, KjunMenuButton, KjunDrawer, } from "./layers.cjs";
|
|
@@ -9,6 +9,7 @@ export { KjunModal, KjunFormActions } from "./modal.js";
|
|
|
9
9
|
export type { KjunModalProps, KjunFormActionsProps } from "./modal.js";
|
|
10
10
|
export type { KjunColors, KjunDomainColors, ColorRole, DomainColorRole, ButtonSize, InputSize, ButtonVariant, } from "@kjun-ui/tokens";
|
|
11
11
|
export * from "./display.js";
|
|
12
|
+
export * from "./layout-primitives.js";
|
|
12
13
|
export * from "./feedback.js";
|
|
13
14
|
export * from "./controls.js";
|
|
14
15
|
export { KjunPopover, KjunTooltip, KjunDropdown, KjunDropdownItem, KjunDropdownDivider, KjunMenuButton, KjunDrawer, } from "./layers.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type StyleProp, type TextStyle, type ViewStyle } from "react-native";
|
|
3
|
+
import { type InlineAlign, type InlineGap, type InlineJustify, type StackAlign, type StackGap, type TextAlign, type TextTone, type TextVariant } from "../../../shared/package-runtime/layout-primitives.cjs";
|
|
4
|
+
export type { InlineAlign, InlineGap, InlineJustify, StackAlign, StackGap, TextAlign, TextTone, TextVariant };
|
|
5
|
+
export interface KjunTextProps {
|
|
6
|
+
/** Typography role; every size, line height and weight comes from tokens.typography. */
|
|
7
|
+
variant?: TextVariant;
|
|
8
|
+
/** Text color role. */
|
|
9
|
+
tone?: TextTone;
|
|
10
|
+
align?: TextAlign;
|
|
11
|
+
/** Clamp to this many lines with an ellipsis (numberOfLines). */
|
|
12
|
+
maxLines?: number;
|
|
13
|
+
style?: StyleProp<TextStyle>;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function KjunText({ variant, tone, align, maxLines, style, children }: KjunTextProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface KjunStackProps {
|
|
18
|
+
/** Space between children: space.stack (sm·md·lg) or space.section (section-sm·md·lg). */
|
|
19
|
+
gap?: StackGap;
|
|
20
|
+
align?: StackAlign;
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare function KjunStack({ gap, align, style, children }: KjunStackProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export interface KjunInlineProps {
|
|
26
|
+
/** Space between children: space.inline (xs·sm·md·lg). */
|
|
27
|
+
gap?: InlineGap;
|
|
28
|
+
align?: InlineAlign;
|
|
29
|
+
justify?: InlineJustify;
|
|
30
|
+
/** Wrap onto new lines when the row runs out of width. Default true. */
|
|
31
|
+
wrap?: boolean;
|
|
32
|
+
style?: StyleProp<ViewStyle>;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export declare function KjunInline({ gap, align, justify, wrap, style, children }: KjunInlineProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type StyleProp, type TextStyle, type ViewStyle } from "react-native";
|
|
3
|
+
import { type InlineAlign, type InlineGap, type InlineJustify, type StackAlign, type StackGap, type TextAlign, type TextTone, type TextVariant } from "../../../shared/package-runtime/layout-primitives.js";
|
|
4
|
+
export type { InlineAlign, InlineGap, InlineJustify, StackAlign, StackGap, TextAlign, TextTone, TextVariant };
|
|
5
|
+
export interface KjunTextProps {
|
|
6
|
+
/** Typography role; every size, line height and weight comes from tokens.typography. */
|
|
7
|
+
variant?: TextVariant;
|
|
8
|
+
/** Text color role. */
|
|
9
|
+
tone?: TextTone;
|
|
10
|
+
align?: TextAlign;
|
|
11
|
+
/** Clamp to this many lines with an ellipsis (numberOfLines). */
|
|
12
|
+
maxLines?: number;
|
|
13
|
+
style?: StyleProp<TextStyle>;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function KjunText({ variant, tone, align, maxLines, style, children }: KjunTextProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface KjunStackProps {
|
|
18
|
+
/** Space between children: space.stack (sm·md·lg) or space.section (section-sm·md·lg). */
|
|
19
|
+
gap?: StackGap;
|
|
20
|
+
align?: StackAlign;
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare function KjunStack({ gap, align, style, children }: KjunStackProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export interface KjunInlineProps {
|
|
26
|
+
/** Space between children: space.inline (xs·sm·md·lg). */
|
|
27
|
+
gap?: InlineGap;
|
|
28
|
+
align?: InlineAlign;
|
|
29
|
+
justify?: InlineJustify;
|
|
30
|
+
/** Wrap onto new lines when the row runs out of width. Default true. */
|
|
31
|
+
wrap?: boolean;
|
|
32
|
+
style?: StyleProp<ViewStyle>;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
export declare function KjunInline({ gap, align, justify, wrap, style, children }: KjunInlineProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type DrawerPosition = "left" | "right" | "top" | "bottom";
|
|
2
|
+
export interface DrawerFrameInput {
|
|
3
|
+
position: DrawerPosition;
|
|
4
|
+
windowHeight: number;
|
|
5
|
+
safeAreaTop: number;
|
|
6
|
+
safeAreaBottom: number;
|
|
7
|
+
/** Space a top or bottom sheet leaves at the opposite edge. */
|
|
8
|
+
gap: number;
|
|
9
|
+
/** Height of the window the keyboard covers (0 when hidden). */
|
|
10
|
+
keyboard: number;
|
|
11
|
+
maxHeight?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DrawerFrame {
|
|
14
|
+
maxHeight: number;
|
|
15
|
+
height: number | undefined;
|
|
16
|
+
paddingTop: number;
|
|
17
|
+
paddingBottom: number;
|
|
18
|
+
lift: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Keyboard events a drawer listens to. Only iOS: React Native's Android Modal window is adjustResize,
|
|
22
|
+
* so the system already shrinks the modal and a measured root height covers it.
|
|
23
|
+
*/
|
|
24
|
+
export declare function keyboardEvents(os: string): {
|
|
25
|
+
readonly show: "keyboardWillShow";
|
|
26
|
+
readonly hide: "keyboardWillHide";
|
|
27
|
+
} | null;
|
|
28
|
+
/** The part of the window the keyboard covers; 0 when the platform already resized the window. */
|
|
29
|
+
export declare function keyboardOverlap(windowHeight: number, keyboardScreenY: number): number;
|
|
30
|
+
export declare function drawerFrame({ position, windowHeight, safeAreaTop, safeAreaBottom, gap, keyboard, maxHeight }: DrawerFrameInput): DrawerFrame;
|
|
31
|
+
/** Web overlay variables read by the drawer CSS (tokens controls.css). */
|
|
32
|
+
export declare function drawerOverlayVars({ safeAreaTop, safeAreaBottom, maxHeight }: {
|
|
33
|
+
safeAreaTop?: number;
|
|
34
|
+
safeAreaBottom?: number;
|
|
35
|
+
maxHeight?: number;
|
|
36
|
+
}): Record<string, string>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type DrawerPosition = "left" | "right" | "top" | "bottom";
|
|
2
|
+
export interface DrawerFrameInput {
|
|
3
|
+
position: DrawerPosition;
|
|
4
|
+
windowHeight: number;
|
|
5
|
+
safeAreaTop: number;
|
|
6
|
+
safeAreaBottom: number;
|
|
7
|
+
/** Space a top or bottom sheet leaves at the opposite edge. */
|
|
8
|
+
gap: number;
|
|
9
|
+
/** Height of the window the keyboard covers (0 when hidden). */
|
|
10
|
+
keyboard: number;
|
|
11
|
+
maxHeight?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DrawerFrame {
|
|
14
|
+
maxHeight: number;
|
|
15
|
+
height: number | undefined;
|
|
16
|
+
paddingTop: number;
|
|
17
|
+
paddingBottom: number;
|
|
18
|
+
lift: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Keyboard events a drawer listens to. Only iOS: React Native's Android Modal window is adjustResize,
|
|
22
|
+
* so the system already shrinks the modal and a measured root height covers it.
|
|
23
|
+
*/
|
|
24
|
+
export declare function keyboardEvents(os: string): {
|
|
25
|
+
readonly show: "keyboardWillShow";
|
|
26
|
+
readonly hide: "keyboardWillHide";
|
|
27
|
+
} | null;
|
|
28
|
+
/** The part of the window the keyboard covers; 0 when the platform already resized the window. */
|
|
29
|
+
export declare function keyboardOverlap(windowHeight: number, keyboardScreenY: number): number;
|
|
30
|
+
export declare function drawerFrame({ position, windowHeight, safeAreaTop, safeAreaBottom, gap, keyboard, maxHeight }: DrawerFrameInput): DrawerFrame;
|
|
31
|
+
/** Web overlay variables read by the drawer CSS (tokens controls.css). */
|
|
32
|
+
export declare function drawerOverlayVars({ safeAreaTop, safeAreaBottom, maxHeight }: {
|
|
33
|
+
safeAreaTop?: number;
|
|
34
|
+
safeAreaBottom?: number;
|
|
35
|
+
maxHeight?: number;
|
|
36
|
+
}): Record<string, string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type TextVariant = "pageTitle" | "sectionTitle" | "cardTitle" | "body" | "label" | "meta" | "caption" | "numberSm" | "numberMd" | "numberLg" | "displaySm" | "displayMd" | "displayLg";
|
|
2
|
+
export type TextTone = "default" | "secondary" | "tertiary" | "disabled";
|
|
3
|
+
export type TextAlign = "start" | "center" | "end";
|
|
4
|
+
export type TextTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div";
|
|
5
|
+
export type StackGap = "none" | "sm" | "md" | "lg" | "section-sm" | "section-md" | "section-lg";
|
|
6
|
+
export type StackAlign = "stretch" | "start" | "center" | "end";
|
|
7
|
+
export type InlineGap = "none" | "xs" | "sm" | "md" | "lg";
|
|
8
|
+
export type InlineAlign = "start" | "center" | "end" | "baseline" | "stretch";
|
|
9
|
+
export type InlineJustify = "start" | "center" | "end" | "between";
|
|
10
|
+
export declare const titleVariants: readonly TextVariant[];
|
|
11
|
+
/** The .kjun-type-* role class (pageTitle → kjun-type-page-title). */
|
|
12
|
+
export declare const textTypeClass: (variant: TextVariant) => string;
|
|
13
|
+
/** Document tag when the app gives no `as`: titles are headings, numbers are inline, the rest are paragraphs. */
|
|
14
|
+
export declare const defaultTextTag: (variant: TextVariant) => TextTag;
|
|
15
|
+
export declare const isNumericVariant: (variant: TextVariant) => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type TextVariant = "pageTitle" | "sectionTitle" | "cardTitle" | "body" | "label" | "meta" | "caption" | "numberSm" | "numberMd" | "numberLg" | "displaySm" | "displayMd" | "displayLg";
|
|
2
|
+
export type TextTone = "default" | "secondary" | "tertiary" | "disabled";
|
|
3
|
+
export type TextAlign = "start" | "center" | "end";
|
|
4
|
+
export type TextTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div";
|
|
5
|
+
export type StackGap = "none" | "sm" | "md" | "lg" | "section-sm" | "section-md" | "section-lg";
|
|
6
|
+
export type StackAlign = "stretch" | "start" | "center" | "end";
|
|
7
|
+
export type InlineGap = "none" | "xs" | "sm" | "md" | "lg";
|
|
8
|
+
export type InlineAlign = "start" | "center" | "end" | "baseline" | "stretch";
|
|
9
|
+
export type InlineJustify = "start" | "center" | "end" | "between";
|
|
10
|
+
export declare const titleVariants: readonly TextVariant[];
|
|
11
|
+
/** The .kjun-type-* role class (pageTitle → kjun-type-page-title). */
|
|
12
|
+
export declare const textTypeClass: (variant: TextVariant) => string;
|
|
13
|
+
/** Document tag when the app gives no `as`: titles are headings, numbers are inline, the rest are paragraphs. */
|
|
14
|
+
export declare const defaultTextTag: (variant: TextVariant) => TextTag;
|
|
15
|
+
export declare const isNumericVariant: (variant: TextVariant) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kjun-ui/native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://ui.kjun.dev",
|
|
6
6
|
"repository": {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"./package.json": "./package.json"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@kjun-ui/tokens": "0.
|
|
51
|
-
"@kjun-ui/icons": "0.
|
|
50
|
+
"@kjun-ui/tokens": "0.12.0",
|
|
51
|
+
"@kjun-ui/icons": "0.12.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": "^19.2.3",
|