@mindlogic-ai/logician-ui 5.0.0-alpha.14 → 5.0.0-alpha.16
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/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.js +4 -1
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/Avatar.mjs +4 -1
- package/dist/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/components/Select/Combobox.d.ts +1 -1
- package/dist/components/Select/Combobox.d.ts.map +1 -1
- package/dist/components/Select/Combobox.js +9 -2
- package/dist/components/Select/Combobox.js.map +1 -1
- package/dist/components/Select/Combobox.mjs +10 -3
- package/dist/components/Select/Combobox.mjs.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +14 -2
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.mjs +15 -3
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/Select/Select.styles.d.ts +96 -0
- package/dist/components/Select/Select.styles.d.ts.map +1 -1
- package/dist/components/Select/Select.styles.js +75 -0
- package/dist/components/Select/Select.styles.js.map +1 -1
- package/dist/components/Select/Select.styles.mjs +74 -1
- package/dist/components/Select/Select.styles.mjs.map +1 -1
- package/dist/translations/Defaults.translations.json.js +10 -1
- package/dist/translations/Defaults.translations.json.js.map +1 -1
- package/dist/translations/Defaults.translations.json.mjs +10 -2
- package/dist/translations/Defaults.translations.json.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.recipe.test.tsx +5 -0
- package/src/components/Avatar/Avatar.tsx +8 -2
- package/src/components/Select/Combobox.tsx +28 -3
- package/src/components/Select/Select.clearTrigger.test.tsx +76 -0
- package/src/components/Select/Select.stories.tsx +81 -0
- package/src/components/Select/Select.styles.ts +81 -0
- package/src/components/Select/Select.tsx +28 -2
- package/src/components/Select/Select.usage.mdx +63 -0
- package/src/translations/Defaults.translations.json +7 -0
|
@@ -96,6 +96,32 @@ Other props: `size` (`xs`–`lg`, default `md`), `invalid`, `disabled`,
|
|
|
96
96
|
`null` when the selection is cleared. `ComboboxField` adds `emptyText`; it has
|
|
97
97
|
no `variant` or `stagger`.
|
|
98
98
|
|
|
99
|
+
## Clearing the value
|
|
100
|
+
|
|
101
|
+
When "nothing chosen" is a valid value, let the user empty the field again: a
|
|
102
|
+
filter, or a form field that is not required. Do not offer it on a required
|
|
103
|
+
field.
|
|
104
|
+
|
|
105
|
+
`ComboboxField` already has the button. `SelectField` has none, so a
|
|
106
|
+
clearable select is composed from `Select.*`. With `Select.*` or
|
|
107
|
+
`Combobox.*`, put `ClearTrigger` in the indicator group, before the chevron:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
<Select.IndicatorGroup>
|
|
111
|
+
<Select.ClearTrigger aria-label="조직 선택 지우기" />
|
|
112
|
+
<Select.Indicator />
|
|
113
|
+
</Select.IndicatorGroup>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The part does the rest. It shows only while something is selected. It draws
|
|
117
|
+
its own icon, smaller and lighter than the chevron, with a divider between
|
|
118
|
+
them. While it shows, the value ends in an ellipsis before it. On a touch
|
|
119
|
+
screen its hit area widens to 44px toward the value, at the field's own
|
|
120
|
+
height. Do not pass a size, a colour or your own divider.
|
|
121
|
+
|
|
122
|
+
`onValueChange` receives an empty value when it is pressed;
|
|
123
|
+
`ComboboxField` passes `null` to `onChange`.
|
|
124
|
+
|
|
99
125
|
## Do / Don't
|
|
100
126
|
|
|
101
127
|
</En>
|
|
@@ -112,6 +138,30 @@ no `variant` or `stagger`.
|
|
|
112
138
|
받습니다. `ComboboxField`에는 `emptyText`가 더 있고, `variant`와 `stagger`는
|
|
113
139
|
없습니다.
|
|
114
140
|
|
|
141
|
+
## 선택 지우기
|
|
142
|
+
|
|
143
|
+
"아무것도 고르지 않음"도 올바른 값일 때는 사용자가 필드를 다시 비울 수 있게 합니다.
|
|
144
|
+
필터나 필수가 아닌 폼 필드가 그렇습니다. 필수 필드에는 두지 않습니다.
|
|
145
|
+
|
|
146
|
+
`ComboboxField`에는 이미 들어 있습니다. `SelectField`에는 없으므로, 지울 수 있는
|
|
147
|
+
셀렉트는 `Select.*`로 조합합니다. `Select.*`나 `Combobox.*`로 조합할 때는
|
|
148
|
+
`ClearTrigger`를 indicator group 안, 화살표 앞에 둡니다.
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
<Select.IndicatorGroup>
|
|
152
|
+
<Select.ClearTrigger aria-label="조직 선택 지우기" />
|
|
153
|
+
<Select.Indicator />
|
|
154
|
+
</Select.IndicatorGroup>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
나머지는 부품이 처리합니다. 무언가 골라져 있을 때만 보입니다. 아이콘을 직접 그리고,
|
|
158
|
+
화살표보다 작고 옅게 그리며, 화살표와의 사이에 구분선을 둡니다. 보이는 동안 값은
|
|
159
|
+
버튼 앞에서 말줄임으로 끝납니다. 터치 화면에서는 누르는 영역이 값 쪽으로 44px까지
|
|
160
|
+
넓어지고, 높이는 필드 높이를 따릅니다. 크기, 색, 구분선을 따로 넘기지 마세요.
|
|
161
|
+
|
|
162
|
+
누르면 `onValueChange`가 빈 값을 받습니다. `ComboboxField`는 `onChange`에
|
|
163
|
+
`null`을 넘깁니다.
|
|
164
|
+
|
|
115
165
|
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
116
166
|
|
|
117
167
|
</Ko>
|
|
@@ -144,6 +194,13 @@ no `variant` or `stagger`.
|
|
|
144
194
|
ko="사용자가 이름을 알고 목록이 길다면 ComboboxField를 씁니다. emptyText의 기본값은 영어이므로 번역해서 넘깁니다."
|
|
145
195
|
/>
|
|
146
196
|
|
|
197
|
+
<Canvas of={SelectStories.Clearable} />
|
|
198
|
+
<Verdict
|
|
199
|
+
kind="do"
|
|
200
|
+
en="On an optional field, put ClearTrigger before the chevron and pass an aria-label that says what is cleared. Without one it is named 'Clear selection' in the provider language."
|
|
201
|
+
ko="필수가 아닌 필드에는 화살표 앞에 ClearTrigger를 두고, 무엇을 지우는지 aria-label로 넘깁니다. 넘기지 않으면 provider 언어의 '선택 지우기'로 읽힙니다."
|
|
202
|
+
/>
|
|
203
|
+
|
|
147
204
|
<Canvas of={SelectStories.DontSelectForTwo} />
|
|
148
205
|
<Verdict
|
|
149
206
|
kind="dont"
|
|
@@ -183,6 +240,9 @@ What these components do for you:
|
|
|
183
240
|
- **Keyboard.** The Chakra / Zag listbox handles it: Enter, Space or the arrow
|
|
184
241
|
keys open the list; arrows move; Enter selects; Escape closes and returns
|
|
185
242
|
focus to the trigger. In `ComboboxField` typing filters the list.
|
|
243
|
+
- **A name for the clear button.** `ClearTrigger` is named 「선택 지우기」 /
|
|
244
|
+
"Clear selection" in the provider language, instead of Chakra's English
|
|
245
|
+
"Clear value" in every locale. A caller's `aria-label` wins.
|
|
186
246
|
- **Focus and states.** The trigger shows a `primary.main` border and ring on
|
|
187
247
|
focus and while open (WCAG 2.4.7). The selected option is bold on
|
|
188
248
|
`primary.selected` and carries a check mark, so it does not rely on colour
|
|
@@ -228,6 +288,9 @@ Generated from `Select.styles.ts`. Select and Combobox share these.
|
|
|
228
288
|
- **키보드.** Chakra와 Zag의 목록 상자가 처리합니다. Enter, Space, 방향키로 목록을
|
|
229
289
|
열고, 방향키로 옮기고, Enter로 고르며, Escape로 닫으면 초점이 트리거로 돌아갑니다.
|
|
230
290
|
`ComboboxField`에서는 입력하면 목록이 걸러집니다.
|
|
291
|
+
- **지우기 버튼의 이름.** `ClearTrigger`는 provider 언어로 「선택 지우기」
|
|
292
|
+
("Clear selection")라는 이름을 가집니다. Chakra 기본값은 어느 언어에서나 영어
|
|
293
|
+
"Clear value"였습니다. 호출부에서 넘긴 `aria-label`이 우선합니다.
|
|
231
294
|
- **초점과 상태.** 트리거는 초점을 받거나 열려 있는 동안 `primary.main` 테두리와 링을
|
|
232
295
|
보여 줍니다(WCAG 2.4.7). 선택된 항목은 `primary.selected` 위에 굵은 글자와 체크
|
|
233
296
|
표시로 나타나므로 색에만 기대지 않습니다(WCAG 1.4.1).
|