@kjun-ui/native 0.11.0 → 0.12.1

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/styles.css CHANGED
@@ -5106,3 +5106,85 @@
5106
5106
  font-family: var(--kjun-font);
5107
5107
  font-variant-numeric: normal;
5108
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; }
@@ -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,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;
@@ -35,6 +35,7 @@ export declare function usePopupFocusGuard(trigger: {
35
35
  };
36
36
  export declare function useActiveLayerScope(): boolean;
37
37
  export declare function focusTrigger(target: FocusTarget | null | undefined): FocusTarget | HTMLElement | null | undefined;
38
+ export declare function isRestorableFocus(item: FocusTarget | null | undefined): boolean;
38
39
  export declare function useLayer(open: boolean, present: boolean, kind: LayerKind, close: () => void, trigger?: {
39
40
  current: FocusTarget | null;
40
41
  }, returnFocus?: () => FocusTarget | null | false | undefined): {
@@ -35,6 +35,7 @@ export declare function usePopupFocusGuard(trigger: {
35
35
  };
36
36
  export declare function useActiveLayerScope(): boolean;
37
37
  export declare function focusTrigger(target: FocusTarget | null | undefined): FocusTarget | HTMLElement | null | undefined;
38
+ export declare function isRestorableFocus(item: FocusTarget | null | undefined): boolean;
38
39
  export declare function useLayer(open: boolean, present: boolean, kind: LayerKind, close: () => void, trigger?: {
39
40
  current: FocusTarget | null;
40
41
  }, returnFocus?: () => FocusTarget | null | false | undefined): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kjun-ui/native",
3
- "version": "0.11.0",
3
+ "version": "0.12.1",
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.11.0",
51
- "@kjun-ui/icons": "0.11.0"
50
+ "@kjun-ui/tokens": "0.12.1",
51
+ "@kjun-ui/icons": "0.12.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": "^19.2.3",