@mindlogic-ai/logician-ui 5.0.0-alpha.12 → 5.0.0-alpha.13
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/README.md +1 -0
- package/dist/components/NavList/NavList.d.ts +34 -0
- package/dist/components/NavList/NavList.d.ts.map +1 -0
- package/dist/components/NavList/NavList.js +113 -0
- package/dist/components/NavList/NavList.js.map +1 -0
- package/dist/components/NavList/NavList.mjs +111 -0
- package/dist/components/NavList/NavList.mjs.map +1 -0
- package/dist/components/NavList/NavList.styles.d.ts +90 -0
- package/dist/components/NavList/NavList.styles.d.ts.map +1 -0
- package/dist/components/NavList/NavList.styles.js +104 -0
- package/dist/components/NavList/NavList.styles.js.map +1 -0
- package/dist/components/NavList/NavList.styles.mjs +97 -0
- package/dist/components/NavList/NavList.styles.mjs.map +1 -0
- package/dist/components/NavList/NavList.translations.json.js +19 -0
- package/dist/components/NavList/NavList.translations.json.js.map +1 -0
- package/dist/components/NavList/NavList.translations.json.mjs +14 -0
- package/dist/components/NavList/NavList.translations.json.mjs.map +1 -0
- package/dist/components/NavList/NavList.types.d.ts +131 -0
- package/dist/components/NavList/NavList.types.d.ts.map +1 -0
- package/dist/components/NavList/NavListContext.d.ts +30 -0
- package/dist/components/NavList/NavListContext.d.ts.map +1 -0
- package/dist/components/NavList/NavListContext.js +16 -0
- package/dist/components/NavList/NavListContext.js.map +1 -0
- package/dist/components/NavList/NavListContext.mjs +13 -0
- package/dist/components/NavList/NavListContext.mjs.map +1 -0
- package/dist/components/NavList/NavListGroup.d.ts +31 -0
- package/dist/components/NavList/NavListGroup.d.ts.map +1 -0
- package/dist/components/NavList/NavListGroup.js +115 -0
- package/dist/components/NavList/NavListGroup.js.map +1 -0
- package/dist/components/NavList/NavListGroup.mjs +113 -0
- package/dist/components/NavList/NavListGroup.mjs.map +1 -0
- package/dist/components/NavList/NavListItem.d.ts +15 -0
- package/dist/components/NavList/NavListItem.d.ts.map +1 -0
- package/dist/components/NavList/NavListItem.js +269 -0
- package/dist/components/NavList/NavListItem.js.map +1 -0
- package/dist/components/NavList/NavListItem.mjs +267 -0
- package/dist/components/NavList/NavListItem.mjs.map +1 -0
- package/dist/components/NavList/NavListSkeleton.d.ts +17 -0
- package/dist/components/NavList/NavListSkeleton.d.ts.map +1 -0
- package/dist/components/NavList/NavListSkeleton.js +33 -0
- package/dist/components/NavList/NavListSkeleton.js.map +1 -0
- package/dist/components/NavList/NavListSkeleton.mjs +31 -0
- package/dist/components/NavList/NavListSkeleton.mjs.map +1 -0
- package/dist/components/NavList/index.d.ts +7 -0
- package/dist/components/NavList/index.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/dist/utils/focusRing.d.ts +22 -0
- package/dist/utils/focusRing.d.ts.map +1 -1
- package/dist/utils/focusRing.js +22 -0
- package/dist/utils/focusRing.js.map +1 -1
- package/dist/utils/focusRing.mjs +21 -1
- package/dist/utils/focusRing.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/Menu/Menu.usage.mdx +8 -0
- package/src/components/NavList/NavList.stories.tsx +895 -0
- package/src/components/NavList/NavList.styles.ts +114 -0
- package/src/components/NavList/NavList.test.tsx +1254 -0
- package/src/components/NavList/NavList.translations.json +9 -0
- package/src/components/NavList/NavList.tsx +160 -0
- package/src/components/NavList/NavList.types.ts +145 -0
- package/src/components/NavList/NavList.usage.mdx +540 -0
- package/src/components/NavList/NavListContext.ts +25 -0
- package/src/components/NavList/NavListGroup.tsx +243 -0
- package/src/components/NavList/NavListItem.tsx +525 -0
- package/src/components/NavList/NavListSkeleton.tsx +57 -0
- package/src/components/NavList/index.ts +14 -0
- package/src/components/Tabs/Tabs.usage.mdx +58 -14
- package/src/components/Tooltip/Tooltip.usage.mdx +8 -0
- package/src/components/a11y.kwcag.test.tsx +66 -0
- package/src/components/claude.md +1 -1
- package/src/index.ts +7 -1
- package/src/utils/focusRing.ts +23 -0
|
@@ -25,16 +25,35 @@ One section shows at a time.
|
|
|
25
25
|
## When not to use
|
|
26
26
|
|
|
27
27
|
- To change how the same content is shown, or to filter it (일/주/월, 목록/카드)
|
|
28
|
-
→ `SegmentedControl`. Tabs change
|
|
28
|
+
→ `SegmentedControl`. Tabs change _what_ you are looking at, not how.
|
|
29
29
|
- For the steps of a flow the user must complete in order → a stepper or a
|
|
30
30
|
sequence of pages. Tabs let the user jump ahead.
|
|
31
|
-
-
|
|
31
|
+
- For destinations or filters, such as the side navigation of an area or a
|
|
32
|
+
filter rail beside a list, and for a list that is long or keeps growing, or
|
|
33
|
+
whose rows carry counts or icons → `NavList`. Tabs own their panels, move
|
|
34
|
+
with the arrow keys and mark the choice with `aria-selected`; a rail is
|
|
35
|
+
links or filters, reached with Tab.
|
|
36
|
+
- To show where this page sits in a hierarchy → `Breadcrumb`.
|
|
32
37
|
- For two or three short panels the user needs side by side → show them on
|
|
33
38
|
the page.
|
|
34
39
|
|
|
40
|
+
## Which component
|
|
41
|
+
|
|
42
|
+
Tabs and `NavList` both mark one row as current; they say the same thing from
|
|
43
|
+
opposite sides. Pick by what the rows are:
|
|
44
|
+
|
|
45
|
+
| What you have | Use |
|
|
46
|
+
| ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
47
|
+
| A few sections of one object that swap a panel in place | `Tabs` |
|
|
48
|
+
| Destinations, or the side navigation of an area | `NavList`, each item with `href` |
|
|
49
|
+
| A filter over one list or grid, with many options or with counts | `NavList`: links (`href`) when the filter state is in the URL, buttons (`onClick`) otherwise |
|
|
50
|
+
| A short horizontal switch of two to five options | `SegmentedControl` |
|
|
51
|
+
| A hierarchy the user expands and collapses | `Tree` |
|
|
52
|
+
| Commands (초대하기, 내보내기) | `Button`, or a `Menu` when there are several |
|
|
53
|
+
|
|
35
54
|
## Variants and what they mean
|
|
36
55
|
|
|
37
|
-
Tabs has one look. A selected tab is a
|
|
56
|
+
Tabs has one look. A selected tab is a _place_, not a value, so it is marked
|
|
38
57
|
with ink and weight, not with a brand or status colour. `orientation` decides
|
|
39
58
|
the layout:
|
|
40
59
|
|
|
@@ -59,9 +78,27 @@ the layout:
|
|
|
59
78
|
씁니다. 탭은 무엇을 보는지를 바꾸고, 어떻게 보는지를 바꾸지 않습니다.
|
|
60
79
|
- 차례대로 끝내야 하는 흐름의 단계에는 단계 표시나 이어지는 페이지를 씁니다. 탭은 사용자가
|
|
61
80
|
단계를 건너뛰게 둡니다.
|
|
62
|
-
-
|
|
81
|
+
- 다른 곳으로 옮겨 가는 항목이나 필터(한 영역의 옆 내비게이션, 목록 옆의 필터 레일)는
|
|
82
|
+
`NavList`가 맡습니다. 항목이 많거나 계속 늘어나는 목록, 항목에 개수나 아이콘이 붙는
|
|
83
|
+
목록도 `NavList`를 씁니다. 탭은 패널을 갖고, 방향키로 옮기며, 고른 것을
|
|
84
|
+
`aria-selected`로 알립니다. 레일은 링크나 필터이고 Tab 키로 오갑니다.
|
|
85
|
+
- 이 페이지가 계층의 어디에 있는지 보여 줄 때는 `Breadcrumb`를 씁니다.
|
|
63
86
|
- 나란히 봐야 하는 짧은 패널 두세 개는 탭에 숨기지 말고 페이지에 그대로 보입니다.
|
|
64
87
|
|
|
88
|
+
## 어떤 컴포넌트를 쓰나요
|
|
89
|
+
|
|
90
|
+
Tabs와 `NavList`는 둘 다 항목 하나를 현재 항목으로 표시합니다. 두 문서는 같은 기준을 서로
|
|
91
|
+
반대쪽에서 설명합니다. 항목이 무엇인지를 보고 고릅니다.
|
|
92
|
+
|
|
93
|
+
| 이런 경우 | 쓰는 컴포넌트 |
|
|
94
|
+
| -------------------------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
95
|
+
| 한 대상의 구역 몇 개를 그 자리에서 패널로 바꿔 보여 줄 때 | `Tabs` |
|
|
96
|
+
| 다른 곳으로 옮겨 가는 항목, 한 영역의 옆 내비게이션 | 항목마다 `href`를 준 `NavList` |
|
|
97
|
+
| 목록이나 그리드 하나를 거르는 필터로, 선택지가 많거나 개수를 붙일 때 | `NavList`. 필터 상태가 URL에 있으면 링크(`href`), 아니면 버튼(`onClick`) |
|
|
98
|
+
| 선택지 둘에서 다섯 개를 가로로 짧게 바꿀 때 | `SegmentedControl` |
|
|
99
|
+
| 펼치고 접는 계층 | `Tree` |
|
|
100
|
+
| 명령(초대하기, 내보내기) | `Button`, 여러 개라면 `Menu` |
|
|
101
|
+
|
|
65
102
|
## 변형과 뜻
|
|
66
103
|
|
|
67
104
|
Tabs의 모양은 하나입니다. 선택된 탭은 값이 아니라 지금 있는 곳이므로, 브랜드색이나
|
|
@@ -69,14 +106,17 @@ Tabs의 모양은 하나입니다. 선택된 탭은 값이 아니라 지금 있
|
|
|
69
106
|
|
|
70
107
|
</Ko>
|
|
71
108
|
|
|
72
|
-
<ArgTypes
|
|
109
|
+
<ArgTypes
|
|
110
|
+
of={TabsStories}
|
|
111
|
+
include={['orientation', 'defaultValue', 'value', 'activationMode']}
|
|
112
|
+
/>
|
|
73
113
|
|
|
74
114
|
<En>
|
|
75
115
|
|
|
76
|
-
| `orientation`
|
|
77
|
-
|
|
|
78
|
-
| `horizontal` (default) | `fg.emphasized` label, semibold, with a 2px `primary.main` underline
|
|
79
|
-
| `vertical`
|
|
116
|
+
| `orientation` | Selected tab | Use for |
|
|
117
|
+
| ---------------------- | ------------------------------------------------------------------------ | -------------------------------------------- |
|
|
118
|
+
| `horizontal` (default) | `fg.emphasized` label, semibold, with a 2px `primary.main` underline | Sections across the top of a page or panel |
|
|
119
|
+
| `vertical` | `bg.muted` fill, bold, with a 2px `primary.main` bar on the leading edge | A long settings page in a narrow side column |
|
|
80
120
|
|
|
81
121
|
## Do / Don't
|
|
82
122
|
|
|
@@ -84,10 +124,10 @@ Tabs의 모양은 하나입니다. 선택된 탭은 값이 아니라 지금 있
|
|
|
84
124
|
|
|
85
125
|
<Ko>
|
|
86
126
|
|
|
87
|
-
| `orientation`
|
|
88
|
-
|
|
|
89
|
-
| `horizontal` (기본) | `fg.emphasized` 글자를 semibold로 쓰고 아래에 2px `primary.main` 밑줄 | 페이지나 패널 위쪽의 구역
|
|
90
|
-
| `vertical`
|
|
127
|
+
| `orientation` | 선택된 탭 | 쓰는 곳 |
|
|
128
|
+
| ------------------- | --------------------------------------------------------------------- | ---------------------------- |
|
|
129
|
+
| `horizontal` (기본) | `fg.emphasized` 글자를 semibold로 쓰고 아래에 2px `primary.main` 밑줄 | 페이지나 패널 위쪽의 구역 |
|
|
130
|
+
| `vertical` | `bg.muted` 배경에 bold, 앞쪽 가장자리에 2px `primary.main` 막대 | 좁은 옆 열에 둔 긴 설정 화면 |
|
|
91
131
|
|
|
92
132
|
## 이렇게 하세요 / 이렇게 하지 마세요
|
|
93
133
|
|
|
@@ -116,7 +156,7 @@ Tabs의 모양은 하나입니다. 선택된 탭은 값이 아니라 지금 있
|
|
|
116
156
|
- Keep labels the same length class; one long label next to short ones reads as
|
|
117
157
|
a different kind of tab.
|
|
118
158
|
- Stay under about six horizontal tabs. More than that, use `vertical` or split
|
|
119
|
-
the page
|
|
159
|
+
the page; if the rows are places or filters, use `NavList`.
|
|
120
160
|
- Do not put a count in the label unless it changes what the user does next.
|
|
121
161
|
|
|
122
162
|
## Accessibility
|
|
@@ -162,6 +202,7 @@ The selected ramp is `TAB_RAMP` in `Tab.styles.ts`; the other tokens are set in
|
|
|
162
202
|
- 라벨 길이를 비슷하게 맞춥니다. 짧은 라벨 사이의 긴 라벨 하나는 다른 종류의 탭처럼
|
|
163
203
|
보입니다.
|
|
164
204
|
- 가로 탭은 여섯 개 안쪽으로 둡니다. 더 많으면 `vertical`을 쓰거나 페이지를 나눕니다.
|
|
205
|
+
항목이 곳이나 필터라면 `NavList`를 씁니다.
|
|
165
206
|
- 다음 행동을 바꾸는 경우가 아니면 라벨에 개수를 넣지 않습니다.
|
|
166
207
|
|
|
167
208
|
## 접근성
|
|
@@ -200,6 +241,8 @@ Tabs가 알아서 하는 일
|
|
|
200
241
|
|
|
201
242
|
## Related
|
|
202
243
|
|
|
244
|
+
- **NavList**: destinations and filters, such as side navigation and filter
|
|
245
|
+
rails.
|
|
203
246
|
- **SegmentedControl**: change how the same content is shown.
|
|
204
247
|
- **Breadcrumb**: where this page sits in a hierarchy.
|
|
205
248
|
- **Foundations/Brand & colour usage**: why a selected place is ink, not
|
|
@@ -211,6 +254,7 @@ Tabs가 알아서 하는 일
|
|
|
211
254
|
|
|
212
255
|
## 관련 컴포넌트
|
|
213
256
|
|
|
257
|
+
- **NavList**: 다른 곳으로 옮겨 가는 항목과 필터. 옆 내비게이션, 필터 레일.
|
|
214
258
|
- **SegmentedControl**: 같은 내용을 보는 방식 바꾸기.
|
|
215
259
|
- **Breadcrumb**: 이 페이지가 계층의 어디에 있는지.
|
|
216
260
|
- **Foundations/Brand & colour usage**: 선택된 곳을 색이 아니라 진한 글자로 표시하는
|
|
@@ -144,6 +144,10 @@ What you still have to do:
|
|
|
144
144
|
shows.
|
|
145
145
|
- Never put the only copy of required information in a tooltip; touch screens
|
|
146
146
|
have no hover.
|
|
147
|
+
- **Tooltip + Menu on one trigger: share `ids.trigger`.** Both make the
|
|
148
|
+
button their trigger and each gives it its own id, so the menu cannot find
|
|
149
|
+
its anchor and opens at the top-left of the page. Pass one `useId()` to
|
|
150
|
+
both: `<Menu ids={{ trigger: id }}><Tooltip ids={{ trigger: id }} …>`.
|
|
147
151
|
|
|
148
152
|
## Tokens
|
|
149
153
|
|
|
@@ -178,6 +182,10 @@ Tooltip이 알아서 하는 일
|
|
|
178
182
|
자식은 실제 버튼, 링크처럼 초점을 받는 요소여야 합니다. 비활성 버튼은 포인터도 초점도
|
|
179
183
|
받지 않아 툴팁이 뜨지 않습니다.
|
|
180
184
|
- 꼭 필요한 정보를 툴팁에만 두지 않습니다. 터치 화면에는 마우스 올리기가 없습니다.
|
|
185
|
+
- **한 버튼에 Tooltip과 Menu를 함께 걸 때는 `ids.trigger`를 같이 씁니다.** 둘 다 그 버튼을
|
|
186
|
+
여는 요소로 삼고 각자 다른 id를 붙이므로, 메뉴가 기준 위치를 못 찾고 화면 왼쪽 위에서
|
|
187
|
+
열립니다. `useId()` 하나를 양쪽에 넘깁니다:
|
|
188
|
+
`<Menu ids={{ trigger: id }}><Tooltip ids={{ trigger: id }} …>`.
|
|
181
189
|
|
|
182
190
|
## 토큰
|
|
183
191
|
|
|
@@ -6,6 +6,7 @@ import { buttonVariantStyles } from '@/components/Button/Button.styles';
|
|
|
6
6
|
import { FileInput } from '@/components/FileInput';
|
|
7
7
|
import { LogicianProvider } from '@/components/LogicianProvider';
|
|
8
8
|
import { baseMarkdownComponents } from '@/components/Markdown/Markdown';
|
|
9
|
+
import { NavList } from '@/components/NavList';
|
|
9
10
|
import { Radio, RadioGroup } from '@/components/Radio';
|
|
10
11
|
import { SelectField } from '@/components/Select';
|
|
11
12
|
import {
|
|
@@ -292,6 +293,71 @@ describe('axe — 구조·ARIA 규칙', () => {
|
|
|
292
293
|
</RadioGroup>,
|
|
293
294
|
],
|
|
294
295
|
['파일 입력', <FileInput key="file" onChange={() => {}} />],
|
|
296
|
+
[
|
|
297
|
+
// Rows are links or buttons with aria-current — never tabs — and the
|
|
298
|
+
// trailing action sits beside its row, not inside it (nested-interactive).
|
|
299
|
+
'내비게이션 목록',
|
|
300
|
+
<NavList key="navlist" aria-label="소스">
|
|
301
|
+
<NavList.Item href="/recent" isCurrent trailingVisual="3">
|
|
302
|
+
최근
|
|
303
|
+
</NavList.Item>
|
|
304
|
+
<NavList.Item href="/off" isDisabled>
|
|
305
|
+
사용 불가
|
|
306
|
+
</NavList.Item>
|
|
307
|
+
<NavList.Group title="공유 드라이브">
|
|
308
|
+
<NavList.Item
|
|
309
|
+
onClick={() => {}}
|
|
310
|
+
trailingAction={
|
|
311
|
+
<button type="button" aria-label="마케팅 옵션">
|
|
312
|
+
…
|
|
313
|
+
</button>
|
|
314
|
+
}
|
|
315
|
+
>
|
|
316
|
+
마케팅
|
|
317
|
+
</NavList.Item>
|
|
318
|
+
<NavList.Item onClick={() => {}} isDisabled>
|
|
319
|
+
보관됨
|
|
320
|
+
</NavList.Item>
|
|
321
|
+
</NavList.Group>
|
|
322
|
+
</NavList>,
|
|
323
|
+
],
|
|
324
|
+
[
|
|
325
|
+
// Icon-only rows keep their label as the name; a new-window link says
|
|
326
|
+
// so in its name; a collapsible group is a disclosure with its list
|
|
327
|
+
// still labelled; a hover-revealed action is still in the tree.
|
|
328
|
+
'접힌 내비게이션 레일과 새 창 링크',
|
|
329
|
+
<NavList key="navlist-collapsed" aria-label="관리자 메뉴" isCollapsed>
|
|
330
|
+
<NavList.Item href="/a" isCurrent leadingVisual={<svg />}>
|
|
331
|
+
멤버 관리
|
|
332
|
+
</NavList.Item>
|
|
333
|
+
<NavList.Item
|
|
334
|
+
href="https://docs.example"
|
|
335
|
+
target="_blank"
|
|
336
|
+
leadingVisual={<svg />}
|
|
337
|
+
>
|
|
338
|
+
사용 가이드
|
|
339
|
+
</NavList.Item>
|
|
340
|
+
</NavList>,
|
|
341
|
+
],
|
|
342
|
+
[
|
|
343
|
+
'접을 수 있는 내비게이션 묶음',
|
|
344
|
+
<NavList key="navlist-collapsible" aria-label="설정">
|
|
345
|
+
<NavList.Group title="결제" isCollapsible>
|
|
346
|
+
<NavList.Item
|
|
347
|
+
href="/b"
|
|
348
|
+
tooltip="요금제와 결제 수단"
|
|
349
|
+
trailingActionVisibility="hover"
|
|
350
|
+
trailingAction={
|
|
351
|
+
<button type="button" aria-label="요금제 옵션">
|
|
352
|
+
…
|
|
353
|
+
</button>
|
|
354
|
+
}
|
|
355
|
+
>
|
|
356
|
+
요금제
|
|
357
|
+
</NavList.Item>
|
|
358
|
+
</NavList.Group>
|
|
359
|
+
</NavList>,
|
|
360
|
+
],
|
|
295
361
|
])('%s', async (_name, ui) => {
|
|
296
362
|
const { container } = withProvider(ui);
|
|
297
363
|
expect(await axeViolations(container)).toEqual([]);
|
package/src/components/claude.md
CHANGED
|
@@ -348,7 +348,7 @@ When adding to `src/index.ts`, follow these categories:
|
|
|
348
348
|
|
|
349
349
|
- **Core Components**: Button, Card, Badge, Tag
|
|
350
350
|
- **Form Components**: Input, Select, Checkbox, Radio
|
|
351
|
-
- **Navigation**: Breadcrumb, Pagination, Menu, Tabs
|
|
351
|
+
- **Navigation**: Breadcrumb, Pagination, Menu, Tabs, NavList
|
|
352
352
|
- **Feedback**: Alert, Toast, Modal, Tooltip
|
|
353
353
|
- **Data Display**: Table, Avatar, Typography, Code
|
|
354
354
|
- **File Components**: FileInput, FileItem, FileList
|
package/src/index.ts
CHANGED
|
@@ -66,6 +66,7 @@ export * from './components/MonthPicker';
|
|
|
66
66
|
export * from './components/Popover';
|
|
67
67
|
|
|
68
68
|
// Navigation Components
|
|
69
|
+
export * from './components/NavList';
|
|
69
70
|
export * from './components/Pagination';
|
|
70
71
|
|
|
71
72
|
// Input Variants
|
|
@@ -178,7 +179,12 @@ export {
|
|
|
178
179
|
} from './theme/motion';
|
|
179
180
|
export { cubicBezier } from './utils/cubicBezier';
|
|
180
181
|
export { disabledControl, disabledText } from './utils/disabledControl';
|
|
181
|
-
export {
|
|
182
|
+
export {
|
|
183
|
+
FOCUS_RING_INSET_SHADOW,
|
|
184
|
+
FOCUS_RING_SHADOW,
|
|
185
|
+
focusRing,
|
|
186
|
+
focusRingInset,
|
|
187
|
+
} from './utils/focusRing';
|
|
182
188
|
export {
|
|
183
189
|
staggerDelayMs,
|
|
184
190
|
type StaggerProps,
|
package/src/utils/focusRing.ts
CHANGED
|
@@ -25,3 +25,26 @@ export const focusRing = {
|
|
|
25
25
|
boxShadow: FOCUS_RING_SHADOW,
|
|
26
26
|
},
|
|
27
27
|
} as const;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The same two bands as {@link FOCUS_RING_SHADOW}, drawn INSIDE the element's
|
|
31
|
+
* edge: the outer 2px in `focus.ring`, then the 2px `bg.canvas` band that keeps
|
|
32
|
+
* the ring legible against whatever fill the element has.
|
|
33
|
+
*
|
|
34
|
+
* {@link focusRing} needs 4px of clear space on every side, because both bands
|
|
35
|
+
* paint outside the box. Rows packed into a list cannot give it that — the band
|
|
36
|
+
* lands on the neighbouring row, which paints its own background back over
|
|
37
|
+
* half of it — and a list that scrolls (`overflow-x: auto`) clips it outright.
|
|
38
|
+
* Same colour and weight, inside the box instead.
|
|
39
|
+
*/
|
|
40
|
+
export const FOCUS_RING_INSET_SHADOW =
|
|
41
|
+
'inset 0 0 0 2px var(--chakra-colors-focus-ring), inset 0 0 0 4px var(--chakra-colors-bg-canvas)';
|
|
42
|
+
|
|
43
|
+
/** {@link focusRing}'s inset counterpart, for rows in a dense or scrolling list. */
|
|
44
|
+
export const focusRingInset = {
|
|
45
|
+
_focus: { outline: 'none' },
|
|
46
|
+
_focusVisible: {
|
|
47
|
+
outline: 'none',
|
|
48
|
+
boxShadow: FOCUS_RING_INSET_SHADOW,
|
|
49
|
+
},
|
|
50
|
+
} as const;
|