zdp-design-system 0.43.8
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/CHANGELOG.md +449 -0
- package/LICENSE +21 -0
- package/README.md +568 -0
- package/THIRD_PARTY_NOTICES.md +34 -0
- package/dist/code.ts +2 -0
- package/dist/combobox.ts +9 -0
- package/dist/command.ts +1 -0
- package/dist/components/Accordion.svelte +97 -0
- package/dist/components/Avatar.svelte +90 -0
- package/dist/components/Badge.svelte +61 -0
- package/dist/components/Breadcrumb.svelte +97 -0
- package/dist/components/Button.svelte +163 -0
- package/dist/components/Callout.svelte +81 -0
- package/dist/components/Card.svelte +151 -0
- package/dist/components/CardHeader.svelte +58 -0
- package/dist/components/Checkbox.svelte +135 -0
- package/dist/components/CodeBlock.svelte +247 -0
- package/dist/components/Combobox.svelte +552 -0
- package/dist/components/CommandField.svelte +230 -0
- package/dist/components/ConfirmAction.svelte +307 -0
- package/dist/components/Container.svelte +63 -0
- package/dist/components/Dialog.svelte +303 -0
- package/dist/components/Disclosure.svelte +176 -0
- package/dist/components/Divider.svelte +41 -0
- package/dist/components/EmptyState.svelte +79 -0
- package/dist/components/ErrorText.svelte +18 -0
- package/dist/components/Field.svelte +38 -0
- package/dist/components/Grid.svelte +76 -0
- package/dist/components/HelpText.svelte +17 -0
- package/dist/components/Icon.svelte +45 -0
- package/dist/components/IconButton.svelte +162 -0
- package/dist/components/IdentityChip.svelte +130 -0
- package/dist/components/Inline.svelte +85 -0
- package/dist/components/InlineCode.svelte +27 -0
- package/dist/components/Input.svelte +109 -0
- package/dist/components/Kbd.svelte +63 -0
- package/dist/components/KeyValue.svelte +73 -0
- package/dist/components/Label.svelte +43 -0
- package/dist/components/Link.svelte +70 -0
- package/dist/components/LocaleSwitcher.svelte +209 -0
- package/dist/components/Menu.svelte +491 -0
- package/dist/components/Page.svelte +36 -0
- package/dist/components/PageHeader.svelte +93 -0
- package/dist/components/Pagination.svelte +297 -0
- package/dist/components/Popover.svelte +208 -0
- package/dist/components/Progress.svelte +111 -0
- package/dist/components/Radio.svelte +132 -0
- package/dist/components/Section.svelte +52 -0
- package/dist/components/SegmentedControl.svelte +190 -0
- package/dist/components/Select.svelte +88 -0
- package/dist/components/ShareDock.svelte +304 -0
- package/dist/components/Sheet.svelte +332 -0
- package/dist/components/ShortcutHint.svelte +52 -0
- package/dist/components/Skeleton.svelte +82 -0
- package/dist/components/SkipLink.svelte +40 -0
- package/dist/components/SortHeader.svelte +138 -0
- package/dist/components/Spinner.svelte +82 -0
- package/dist/components/Stack.svelte +62 -0
- package/dist/components/StatusToast.svelte +133 -0
- package/dist/components/Surface.svelte +53 -0
- package/dist/components/Switch.svelte +152 -0
- package/dist/components/Table.svelte +94 -0
- package/dist/components/TableToolbar.svelte +195 -0
- package/dist/components/Tabs.svelte +205 -0
- package/dist/components/TermSheet.svelte +392 -0
- package/dist/components/TermTrigger.svelte +70 -0
- package/dist/components/TextScaleControl.svelte +219 -0
- package/dist/components/Textarea.svelte +106 -0
- package/dist/components/ThemeToggle.svelte +148 -0
- package/dist/components/Toast.svelte +180 -0
- package/dist/components/Toolbar.svelte +83 -0
- package/dist/components/Tooltip.svelte +199 -0
- package/dist/components/VisuallyHidden.svelte +18 -0
- package/dist/disclosure.ts +11 -0
- package/dist/focusable.ts +36 -0
- package/dist/identity.ts +5 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.js +76 -0
- package/dist/index.ts +106 -0
- package/dist/menu.ts +12 -0
- package/dist/modal-layer.ts +108 -0
- package/dist/pagination.ts +10 -0
- package/dist/preferences.js +14 -0
- package/dist/preferences.ts +36 -0
- package/dist/progress.ts +4 -0
- package/dist/schemas/design-tokens.schema.json +119 -0
- package/dist/segmented.ts +8 -0
- package/dist/share.d.ts +48 -0
- package/dist/share.js +115 -0
- package/dist/share.ts +99 -0
- package/dist/sheet.ts +3 -0
- package/dist/shortcuts.js +125 -0
- package/dist/shortcuts.ts +153 -0
- package/dist/styles/brand-fonts.css +10 -0
- package/dist/styles/components.css +4686 -0
- package/dist/styles/expressive-fonts.css +2 -0
- package/dist/styles/index.css +2 -0
- package/dist/styles/locale-fonts.css +4 -0
- package/dist/styles/tokens.css +413 -0
- package/dist/table-tools.ts +10 -0
- package/dist/term.ts +16 -0
- package/dist/theme.ts +2 -0
- package/dist/toast.ts +14 -0
- package/dist/tokens/zdp.tokens.json +241 -0
- package/dist/tokens.js +122 -0
- package/dist/tokens.ts +123 -0
- package/docs/CONSUMER_CONTRACT.md +482 -0
- package/docs/EXTERNAL_UI_ADOPTION.md +141 -0
- package/docs/INTERACTIVE_PRIMITIVE_AUDIT.md +127 -0
- package/package.json +78 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Interactive Primitive Audit
|
|
2
|
+
|
|
3
|
+
이 문서는 고난도 interactive primitive를 외부 headless 구현 후보에 올릴지 판단하기 위한 현재 상태 감사다.
|
|
4
|
+
기준은 `docs/EXTERNAL_UI_ADOPTION.md`의 흡수 등급을 따른다.
|
|
5
|
+
|
|
6
|
+
## 결론
|
|
7
|
+
|
|
8
|
+
- 지금 당장 Bits UI, shadcn-svelte, Ark UI를 package dependency로 추가하지 않는다.
|
|
9
|
+
- `Select`와 `CommandField`는 native element를 중심으로 둔 현재 구현을 유지한다.
|
|
10
|
+
- `Combobox`는 searchable single-select를 ZDP-native로 제공하되 filtering, async search, command execution, permissions는 소비 앱에 남긴다.
|
|
11
|
+
- `Dialog`, `Sheet`, `TermSheet`는 ZDP modal layer, focusable helper, scroll lock, focus return을 유지하되 nested modal, inert sibling, portal 요구가 커지면 headless 후보로 다시 평가한다.
|
|
12
|
+
- `Sheet`는 settings, filter, drawer형 보조 흐름의 공통 modal edge panel이다. Drawer를 별도 primitive로 복제하지 않고 Sheet placement/use case로 먼저 다룬다.
|
|
13
|
+
- `Menu`와 `Popover`는 가장 높은 위험군이다. 단순 더보기와 짧은 필터 표면은 현재 구현으로 유지하되, typeahead, submenu, collision detection, portal, nested overlay가 필요해지면 Bits UI 내부 의존성 후보로 올린다.
|
|
14
|
+
- `Tooltip`은 짧은 non-interactive label로만 유지한다. 긴 안내, 클릭 가능한 내용, mobile-first 설명은 Popover, Disclosure, Dialog, 소비 앱 flow로 보낸다.
|
|
15
|
+
|
|
16
|
+
## 감사 매트릭스
|
|
17
|
+
|
|
18
|
+
| Primitive | Current Base | Risk | Current Coverage | Do Next |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| Select | Native `select` | Low | label/id/error/describedBy, invalid, disabled, required, focus-visible | Custom select나 combobox 요구 전까지 유지 |
|
|
21
|
+
| CommandField | Native `input` | Low | label, shortcut hint, aria-keyshortcuts/autocomplete/controls/expanded/activedescendant passthrough, input keydown callback | result list, dispatcher, command palette는 별도 primitive로 분리 |
|
|
22
|
+
| Combobox | ZDP custom combobox/listbox | Medium | input combobox role, listbox/option roles, ArrowUp/ArrowDown, Enter select, Escape close, disabled skip, hidden value, InteractionProbe play coverage | grouped options, virtualized list, async option loading, multi-select, portal/collision 요구 시 headless spike |
|
|
23
|
+
| Tooltip | CSS hover/focus label | Low | role tooltip, slot-provided `describedBy`, Escape dismiss, pointer-events none | interactive content 금지 유지 |
|
|
24
|
+
| Dialog | ZDP custom modal | Medium | Escape, backdrop close, focus trap, focus return, scroll lock, modal layer | nested modal, portal, inert sibling 요구가 생기면 headless spike |
|
|
25
|
+
| Sheet | ZDP custom modal edge panel | Medium | right/left/bottom placement, Escape, backdrop close, focus trap, focus return, scroll lock, modal layer, InteractionProbe play coverage | draggable sheet, snap point, nested modal, portal, inert sibling 요구가 생기면 headless spike |
|
|
26
|
+
| TermSheet | ZDP glossary sheet | Medium | Escape, backdrop close, focus trap, focus return, scroll lock, stable term attributes | glossary 외 설정/필터/drawer 요구는 Sheet로 보낸다 |
|
|
27
|
+
| Menu | ZDP custom menu | High | trigger keyboard open, roving focus, disabled skip, Home/End, Escape, outside click, focus return, InteractionProbe play coverage | typeahead, submenu, pointerdown outside, collision/portal 요구 시 Bits UI 후보 |
|
|
28
|
+
| Popover | ZDP custom non-modal overlay | High | Escape, outside click, trigger focus policy, focus return, role/dialog passthrough, InteractionProbe play coverage | first focus policy, collision/portal, nested overlay 요구 시 Bits UI 후보 |
|
|
29
|
+
|
|
30
|
+
## Component Notes
|
|
31
|
+
|
|
32
|
+
### Select
|
|
33
|
+
|
|
34
|
+
`Select`는 native `select`를 감싼다.
|
|
35
|
+
이 단계에서는 Bits UI나 Ark UI를 넣을 이유가 없다.
|
|
36
|
+
custom trigger, searchable option, grouped option, virtualized list, async option loading이 필요해지는 순간 새 `Combobox` 또는 custom `Select` 작업으로 분리한다.
|
|
37
|
+
|
|
38
|
+
### CommandField
|
|
39
|
+
|
|
40
|
+
`CommandField`는 input frame과 shortcut hint만 맡는다.
|
|
41
|
+
검색 결과, listbox, command execution, 전역 keydown dispatcher를 직접 만들지 않는다.
|
|
42
|
+
`aria-keyshortcuts`, `aria-autocomplete`, `aria-controls`, `aria-expanded`, `aria-activedescendant`, `onkeydown`은 소비 앱이 실제 shortcut focus, result surface, keyboard behavior를 붙일 때만 전달한다.
|
|
43
|
+
|
|
44
|
+
### Combobox
|
|
45
|
+
|
|
46
|
+
`Combobox`는 검색 가능한 단일 선택 입력이다.
|
|
47
|
+
ZDP는 label, input frame, listbox, active option, disabled option skip, hidden submitted value, keyboard navigation만 소유한다.
|
|
48
|
+
소비 앱은 option source, filtering, async search, result ranking, command execution, permission visibility를 계속 소유한다.
|
|
49
|
+
단순 상태 선택은 native `Select`를 유지하고, 사용자가 입력으로 후보를 좁혀야 하는 단일 선택에만 `Combobox`를 쓴다.
|
|
50
|
+
InteractionProbe는 ArrowDown open, disabled skip, Enter select, Escape close, listbox label, selected value sync를 계속 확인한다.
|
|
51
|
+
|
|
52
|
+
### Tooltip
|
|
53
|
+
|
|
54
|
+
`Tooltip`은 짧은 설명 text만 노출한다.
|
|
55
|
+
Tooltip 안에 button, link, form field를 넣지 않는다.
|
|
56
|
+
Escape로 현재 tooltip을 dismiss할 수 있어야 한다.
|
|
57
|
+
viewport collision과 mobile long-press를 해결하려고 floating engine으로 키우지 않는다.
|
|
58
|
+
그 요구는 Popover나 별도 help surface로 보낸다.
|
|
59
|
+
|
|
60
|
+
### Dialog
|
|
61
|
+
|
|
62
|
+
`Dialog`는 custom modal로 유지한다.
|
|
63
|
+
현재 기준은 Escape close, backdrop close, Tab trap, Shift+Tab trap, focus return, shared focusability helper, modal layer scroll lock이다.
|
|
64
|
+
다만 sibling inert 처리, portal target, nested dialog priority, animation orchestration은 아직 소유하지 않는다.
|
|
65
|
+
이 요구가 실제 제품에서 반복되면 Runtime Dependency 등급으로 Bits UI 또는 Ark UI를 spike한다.
|
|
66
|
+
|
|
67
|
+
### Sheet
|
|
68
|
+
|
|
69
|
+
`Sheet`는 settings, filter, drawer형 보조 흐름을 위한 reusable modal edge panel이다.
|
|
70
|
+
현재 기준은 right, left, bottom placement, Escape close, backdrop close, Tab trap, Shift+Tab trap, focus return, shared focusability helper, modal layer scroll lock, stable sheet data attributes다.
|
|
71
|
+
저장, 권한, 데이터 fetch, 라우팅 판단은 소비 앱에 남긴다.
|
|
72
|
+
드래그 가능한 bottom sheet, snap point, nested sheet, sibling inert, portal target, mobile keyboard avoidance가 반복되면 이 컴포넌트 안에서 계속 키우지 말고 Bits UI 또는 Ark UI headless spike를 연다.
|
|
73
|
+
|
|
74
|
+
### TermSheet
|
|
75
|
+
|
|
76
|
+
`TermSheet`는 glossary/domain sheet로 유지한다.
|
|
77
|
+
현재 기준은 Dialog와 같은 focus/scroll lock 계열에 stable term attributes와 `data-zdp-ad-exclude`를 더한 형태다.
|
|
78
|
+
settings, filter, drawer형 보조 흐름은 TermSheet에 추가하지 않고 `Sheet`로 보낸다.
|
|
79
|
+
|
|
80
|
+
### Menu
|
|
81
|
+
|
|
82
|
+
`Menu`는 현재 가장 조심해야 하는 primitive다.
|
|
83
|
+
현재 구현은 단순 action menu에 충분하지만 typeahead, submenu, checkbox/radio menu item, collision, portal, pointerdown outside, nested menu를 직접 늘리기 시작하면 접근성 부채가 빠르게 커진다.
|
|
84
|
+
그 지점부터는 Behavior Spec이 아니라 Runtime Dependency 후보로 전환한다.
|
|
85
|
+
단, Bits UI를 쓰더라도 `ZdpMenuItem`, `.zdp-menu*` class, token mapping, Storybook examples, consumer fixture는 ZDP가 소유한다.
|
|
86
|
+
InteractionProbe는 ArrowDown open, roving focus, disabled skip, Home/End, Escape close, focus return, click select를 계속 확인한다.
|
|
87
|
+
|
|
88
|
+
### Popover
|
|
89
|
+
|
|
90
|
+
`Popover`는 non-modal floating panel이다.
|
|
91
|
+
현재는 짧은 필터, 작은 설정, 간단한 정보 패널에만 쓴다.
|
|
92
|
+
panel open 시 첫 focus를 강제로 옮기지 않는 정책은 non-modal popover 기준에서는 허용하지만, form-heavy popover나 dialog-like popover가 늘면 policy를 다시 정해야 한다.
|
|
93
|
+
collision/flip/portal/nested overlay 요구가 반복되면 내부 headless 의존성 후보로 올린다.
|
|
94
|
+
InteractionProbe는 trigger focus 유지, Escape close, focus return, outside click close를 계속 확인한다.
|
|
95
|
+
|
|
96
|
+
## Headless Spike Trigger
|
|
97
|
+
|
|
98
|
+
다음 중 두 개 이상이 같은 primitive에서 반복되면 직접 구현 확장 대신 headless spike를 연다.
|
|
99
|
+
|
|
100
|
+
- typeahead search
|
|
101
|
+
- submenu 또는 nested overlay
|
|
102
|
+
- collision detection, flip, shift
|
|
103
|
+
- portal target
|
|
104
|
+
- roving focus가 여러 axis로 확장
|
|
105
|
+
- aria-activedescendant 기반 virtual focus
|
|
106
|
+
- checkbox/radio menu item
|
|
107
|
+
- async option list
|
|
108
|
+
- draggable sheet 또는 snap point
|
|
109
|
+
- sibling inert 처리
|
|
110
|
+
- mobile viewport keyboard 대응
|
|
111
|
+
|
|
112
|
+
## Spike Rule
|
|
113
|
+
|
|
114
|
+
headless spike는 바로 dependency adoption이 아니다.
|
|
115
|
+
spike 결과는 다음을 남겨야 한다.
|
|
116
|
+
|
|
117
|
+
- candidate package and version
|
|
118
|
+
- license
|
|
119
|
+
- adoption grade
|
|
120
|
+
- public API leakage check
|
|
121
|
+
- CSS token mapping
|
|
122
|
+
- Storybook interaction coverage
|
|
123
|
+
- addon-a11y result
|
|
124
|
+
- consumer fixture result
|
|
125
|
+
- THIRD_PARTY_NOTICES impact
|
|
126
|
+
|
|
127
|
+
public API, class, token, consumer setup에 외부 철학이 새면 spike는 실패다.
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zdp-design-system",
|
|
3
|
+
"version": "0.43.8",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"description": "ZDP design tokens, CSS, icons, and Svelte UI package boundary.",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"svelte": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./styles.css": "./dist/styles/index.css",
|
|
16
|
+
"./brand-fonts.css": "./dist/styles/brand-fonts.css",
|
|
17
|
+
"./expressive-fonts.css": "./dist/styles/expressive-fonts.css",
|
|
18
|
+
"./locale-fonts.css": "./dist/styles/locale-fonts.css",
|
|
19
|
+
"./share": {
|
|
20
|
+
"types": "./dist/share.d.ts",
|
|
21
|
+
"import": "./dist/share.js",
|
|
22
|
+
"default": "./dist/share.js"
|
|
23
|
+
},
|
|
24
|
+
"./tokens": "./dist/tokens/zdp.tokens.json"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist/",
|
|
28
|
+
"docs/",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"CHANGELOG.md",
|
|
32
|
+
"THIRD_PARTY_NOTICES.md"
|
|
33
|
+
],
|
|
34
|
+
"sideEffects": [
|
|
35
|
+
"./dist/styles/index.css",
|
|
36
|
+
"./dist/styles/brand-fonts.css",
|
|
37
|
+
"./dist/styles/expressive-fonts.css",
|
|
38
|
+
"./dist/styles/locale-fonts.css",
|
|
39
|
+
"./dist/styles/tokens.css",
|
|
40
|
+
"./dist/styles/components.css"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"dev": "storybook dev -p 6006",
|
|
44
|
+
"build": "storybook build",
|
|
45
|
+
"tokens:generate": "bun scripts/generate-tokens.ts",
|
|
46
|
+
"tokens:check": "bun scripts/generate-tokens.ts --check && bun scripts/check-tokens.ts",
|
|
47
|
+
"consumer:check": "bun scripts/check-consumer-contract.ts",
|
|
48
|
+
"share-icons:generate": "bun scripts/generate-share.ts",
|
|
49
|
+
"share-icons:check": "bun scripts/generate-share.ts --check && bun scripts/check-share-icons.ts",
|
|
50
|
+
"preview:check": "bun scripts/check-preview.ts",
|
|
51
|
+
"a11y:check": "bun scripts/check-storybook-a11y.ts",
|
|
52
|
+
"type:check": "svelte-check --tsconfig ./tsconfig.json",
|
|
53
|
+
"package:build": "bun scripts/generate-tokens.ts && bun scripts/generate-share.ts && bun scripts/build-package.ts",
|
|
54
|
+
"package:check": "bun scripts/check-package.ts",
|
|
55
|
+
"publish:check": "bun scripts/check-publish-readiness.ts",
|
|
56
|
+
"fixtures:check": "bun scripts/check-consumer-fixtures.ts",
|
|
57
|
+
"storybook": "bun run dev",
|
|
58
|
+
"storybook:build": "bun run build",
|
|
59
|
+
"storybook:check": "bun scripts/check-storybook.ts",
|
|
60
|
+
"check": "bun run tokens:check && bun run consumer:check && bun run share-icons:check && bun run preview:check && bun run storybook:check && bun run a11y:check && bun run type:check && bun run package:build && bun run package:check && bun run publish:check && bun run fixtures:check"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@storybook/addon-a11y": "10.4.2",
|
|
64
|
+
"@storybook/svelte-vite": "10.4.2",
|
|
65
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
66
|
+
"@tsconfig/svelte": "5.0.8",
|
|
67
|
+
"@types/node": "26.0.1",
|
|
68
|
+
"simple-icons": "^16.23.0",
|
|
69
|
+
"storybook": "10.4.2",
|
|
70
|
+
"svelte": "^5.56.3",
|
|
71
|
+
"svelte-check": "4.7.1",
|
|
72
|
+
"typescript": "5.9.3",
|
|
73
|
+
"vite": "^7.3.5"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"svelte": "^5.0.0"
|
|
77
|
+
}
|
|
78
|
+
}
|