@sakura-ui/sakura-ui 0.4.2 → 0.5.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/README.md +77 -0
- package/package.json +5 -5
- package/packages/core/package.json +1 -1
- package/packages/core/src/components/Card.tsx +51 -32
- package/packages/core/src/components/Faq.tsx +8 -24
- package/packages/core/src/components/LangSelector.tsx +2 -2
- package/packages/core/src/components/LinkCard.tsx +103 -54
- package/packages/core/src/components/PopoverMenu.tsx +2 -13
- package/packages/core/src/components/Table.tsx +1 -1
- package/packages/core/src/components/index.ts +1 -0
- package/packages/core/src/index.ts +2 -0
- package/packages/core/tests/Card.test.tsx +124 -20
- package/packages/core/tests/Faq.test.tsx +75 -0
- package/packages/core/tests/LinkCard.test.tsx +151 -0
- package/packages/forms/.turbo/turbo-build.log +3 -3
- package/packages/forms/dist/index.cjs.js +13 -21
- package/packages/forms/dist/index.es.js +91 -99
- package/packages/forms/package.json +1 -1
- package/packages/helper/.turbo/turbo-build.log +3 -3
- package/packages/helper/dist/index.cjs.js +6 -14
- package/packages/helper/dist/index.es.js +18 -26
- package/packages/helper/dist/types/styles.d.ts +2 -4
- package/packages/helper/dist/types/styles.d.ts.map +1 -1
- package/packages/helper/package.json +1 -1
- package/packages/helper/src/styles.ts +2 -14
- package/packages/markdown/.turbo/turbo-build.log +4 -4
- package/packages/markdown/dist/index.cjs.js +25 -33
- package/packages/markdown/dist/index.es.js +1531 -1534
- package/packages/markdown/dist/types/components/Markdown.d.ts.map +1 -1
- package/packages/markdown/dist/types/plugins/card.d.ts.map +1 -1
- package/packages/markdown/package.json +3 -2
- package/packages/markdown/src/components/Markdown.tsx +35 -11
- package/packages/markdown/src/plugins/card.ts +14 -0
- package/packages/tailwind-theme-plugin/.turbo/turbo-build.log +2 -2
- package/packages/tailwind-theme-plugin/package.json +1 -1
|
@@ -2,46 +2,150 @@ import React from 'react'
|
|
|
2
2
|
import { describe, expect, it } from 'vitest'
|
|
3
3
|
import { render, screen } from '@testing-library/react'
|
|
4
4
|
|
|
5
|
-
import { Card, CardBody, CardHeader } from '../src'
|
|
5
|
+
import { Card, CardBody, CardFooter, CardHeader } from '../src'
|
|
6
6
|
|
|
7
7
|
describe('Card', () => {
|
|
8
|
-
it('should
|
|
8
|
+
it('should render its header and body', async () => {
|
|
9
9
|
render(
|
|
10
10
|
<Card>
|
|
11
|
-
<CardHeader>Card-Header</CardHeader>
|
|
11
|
+
<CardHeader as="h3">Card-Header</CardHeader>
|
|
12
12
|
<CardBody>Card-Body</CardBody>
|
|
13
13
|
</Card>
|
|
14
14
|
)
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
expect(
|
|
16
|
+
expect(screen.getByText('Card-Header')).toBeInTheDocument()
|
|
17
|
+
expect(screen.getByText('Card-Body')).toBeInTheDocument()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('should render the header as the element given by the as property', async () => {
|
|
21
|
+
render(
|
|
22
|
+
<Card>
|
|
23
|
+
<CardHeader as="h4">Card-Header</CardHeader>
|
|
24
|
+
</Card>
|
|
25
|
+
)
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
// Querying by role rather than by tag name: the point of the change is that
|
|
28
|
+
// the title is reachable by heading navigation, not that it is an <h4>.
|
|
29
|
+
expect(
|
|
30
|
+
screen.getByRole('heading', { level: 4, name: 'Card-Header' })
|
|
31
|
+
).toBeInTheDocument()
|
|
21
32
|
})
|
|
22
|
-
|
|
33
|
+
|
|
34
|
+
it('should render the header as a paragraph when asked to', async () => {
|
|
23
35
|
render(
|
|
24
36
|
<Card>
|
|
25
|
-
<CardHeader
|
|
37
|
+
<CardHeader as="p">Card-Header</CardHeader>
|
|
38
|
+
</Card>
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
// Lists of many cards use 'p' so that the headings do not pollute the outline.
|
|
42
|
+
expect(screen.queryByRole('heading')).toBeNull()
|
|
43
|
+
expect(screen.getByText('Card-Header')).toBeInTheDocument()
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('should render the root as the element given by the as property', async () => {
|
|
47
|
+
render(
|
|
48
|
+
<Card as="article">
|
|
49
|
+
<CardHeader as="h3">Card-Header</CardHeader>
|
|
50
|
+
</Card>
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
expect(screen.getByRole('article')).toBeInTheDocument()
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('should not generate any id or aria reference of its own', async () => {
|
|
57
|
+
const { container } = render(
|
|
58
|
+
<Card as="article">
|
|
59
|
+
<CardHeader as="h3" data-testid="header">
|
|
60
|
+
Card-Header
|
|
61
|
+
</CardHeader>
|
|
26
62
|
<CardBody data-testid="body">Card-Body</CardBody>
|
|
27
63
|
</Card>
|
|
28
64
|
)
|
|
29
65
|
|
|
30
66
|
const card = screen.getByRole('article')
|
|
31
|
-
|
|
67
|
+
// A generated id can only ever dangle or collide, so the library emits none.
|
|
68
|
+
// Callers that want the card named do it themselves, see the test below.
|
|
69
|
+
expect(card).not.toHaveAttribute('aria-labelledby')
|
|
70
|
+
expect(card).not.toHaveAttribute('aria-describedby')
|
|
71
|
+
expect(screen.getByTestId('header')).not.toHaveAttribute('id')
|
|
72
|
+
expect(screen.getByTestId('body')).not.toHaveAttribute('id')
|
|
73
|
+
expect(container.querySelector('[id=""]')).toBeNull()
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it('should not repeat an id when more than one body is rendered', async () => {
|
|
77
|
+
render(
|
|
78
|
+
<Card>
|
|
79
|
+
<CardBody data-testid="body1">Body-1</CardBody>
|
|
80
|
+
<CardBody data-testid="body2">Body-2</CardBody>
|
|
81
|
+
</Card>
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
expect(screen.getByTestId('body1')).not.toHaveAttribute('id')
|
|
85
|
+
expect(screen.getByTestId('body2')).not.toHaveAttribute('id')
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it('should let the caller name the card explicitly', async () => {
|
|
89
|
+
render(
|
|
90
|
+
<Card as="article" aria-labelledby="card-title" aria-describedby="card-desc">
|
|
91
|
+
<CardHeader as="h3" id="card-title">
|
|
92
|
+
Card-Header
|
|
93
|
+
</CardHeader>
|
|
94
|
+
<CardBody id="card-desc">Card-Body</CardBody>
|
|
95
|
+
</Card>
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
const card = screen.getByRole('article')
|
|
99
|
+
expect(card).toHaveAccessibleName('Card-Header')
|
|
100
|
+
expect(card).toHaveAccessibleDescription('Card-Body')
|
|
101
|
+
})
|
|
32
102
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
103
|
+
it('should render a card without a header', async () => {
|
|
104
|
+
render(
|
|
105
|
+
<Card as="article">
|
|
106
|
+
<CardBody>Card-Body</CardBody>
|
|
107
|
+
</Card>
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
// Used to leave aria-labelledby pointing at an element that was never rendered.
|
|
111
|
+
const card = screen.getByRole('article')
|
|
112
|
+
expect(card).not.toHaveAttribute('aria-labelledby')
|
|
113
|
+
expect(card).toHaveAccessibleName('')
|
|
114
|
+
})
|
|
36
115
|
|
|
37
|
-
|
|
38
|
-
|
|
116
|
+
it('should say which property is missing when as is left out', async () => {
|
|
117
|
+
// React would otherwise report an invalid element type and suggest a missing
|
|
118
|
+
// export, which points nowhere near the actual mistake.
|
|
119
|
+
const Header = CardHeader as unknown as React.ComponentType<{
|
|
120
|
+
children: React.ReactNode
|
|
121
|
+
}>
|
|
39
122
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
123
|
+
expect(() =>
|
|
124
|
+
render(
|
|
125
|
+
<Card>
|
|
126
|
+
<Header>Card-Header</Header>
|
|
127
|
+
</Card>
|
|
128
|
+
)
|
|
129
|
+
).toThrow(/CardHeader: the "as" property is required/)
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it('should pass unknown properties through to the elements', async () => {
|
|
133
|
+
render(
|
|
134
|
+
<Card>
|
|
135
|
+
<CardHeader as="h3" data-testid="header" data-kind="title">
|
|
136
|
+
Card-Header
|
|
137
|
+
</CardHeader>
|
|
138
|
+
<CardBody data-testid="body" data-kind="desc">
|
|
139
|
+
Card-Body
|
|
140
|
+
</CardBody>
|
|
141
|
+
<CardFooter data-testid="footer" data-kind="meta">
|
|
142
|
+
Card-Footer
|
|
143
|
+
</CardFooter>
|
|
144
|
+
</Card>
|
|
145
|
+
)
|
|
43
146
|
|
|
44
|
-
|
|
45
|
-
expect(
|
|
147
|
+
expect(screen.getByTestId('header')).toHaveAttribute('data-kind', 'title')
|
|
148
|
+
expect(screen.getByTestId('body')).toHaveAttribute('data-kind', 'desc')
|
|
149
|
+
expect(screen.getByTestId('footer')).toHaveAttribute('data-kind', 'meta')
|
|
46
150
|
})
|
|
47
151
|
})
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { describe, expect, it } from 'vitest'
|
|
3
|
+
import { render, screen } from '@testing-library/react'
|
|
4
|
+
|
|
5
|
+
import { Answer, Faq, Question } from '../src'
|
|
6
|
+
|
|
7
|
+
describe('Faq', () => {
|
|
8
|
+
it('should render the questions and the answers', async () => {
|
|
9
|
+
render(
|
|
10
|
+
<Faq>
|
|
11
|
+
<Question>Question-1</Question>
|
|
12
|
+
<Answer>Answer-1</Answer>
|
|
13
|
+
<Question>Question-2</Question>
|
|
14
|
+
<Answer>Answer-2</Answer>
|
|
15
|
+
</Faq>
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
expect(screen.getByText('Question-1')).toBeInTheDocument()
|
|
19
|
+
expect(screen.getByText('Answer-1')).toBeInTheDocument()
|
|
20
|
+
expect(screen.getByText('Question-2')).toBeInTheDocument()
|
|
21
|
+
expect(screen.getByText('Answer-2')).toBeInTheDocument()
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it('should keep the Q and A markers out of the accessibility tree', async () => {
|
|
25
|
+
render(
|
|
26
|
+
<Faq>
|
|
27
|
+
<Question data-testid="question">Question-1</Question>
|
|
28
|
+
<Answer>Answer-1</Answer>
|
|
29
|
+
</Faq>
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
// The letters are there for the eye only; a reader gets the question text.
|
|
33
|
+
const marker = screen.getByTestId('question').firstElementChild
|
|
34
|
+
expect(marker).toHaveTextContent('Q')
|
|
35
|
+
expect(marker).toHaveAttribute('aria-hidden', 'true')
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('should render a plain definition list', async () => {
|
|
39
|
+
const { container } = render(
|
|
40
|
+
<Faq>
|
|
41
|
+
<Question>Question-1</Question>
|
|
42
|
+
<Answer>Answer-1</Answer>
|
|
43
|
+
<Question>Question-2</Question>
|
|
44
|
+
<Answer>Answer-2</Answer>
|
|
45
|
+
</Faq>
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
// The schema.org markup described the whole list as one Question carrying a
|
|
49
|
+
// name and an answer per pair, and it wrapped everything in an article that
|
|
50
|
+
// nothing could name. Both are gone.
|
|
51
|
+
expect(container.querySelector('[itemscope]')).toBeNull()
|
|
52
|
+
expect(container.querySelector('[itemprop]')).toBeNull()
|
|
53
|
+
expect(container.querySelector('article')).toBeNull()
|
|
54
|
+
expect(container.querySelector('dl')).toBeInTheDocument()
|
|
55
|
+
expect(container.querySelectorAll('dt')).toHaveLength(2)
|
|
56
|
+
expect(container.querySelectorAll('dd')).toHaveLength(2)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('should pass unknown properties through to the elements', async () => {
|
|
60
|
+
render(
|
|
61
|
+
<Faq data-testid="faq" data-kind="list">
|
|
62
|
+
<Question data-testid="question" data-kind="q">
|
|
63
|
+
Question-1
|
|
64
|
+
</Question>
|
|
65
|
+
<Answer data-testid="answer" data-kind="a">
|
|
66
|
+
Answer-1
|
|
67
|
+
</Answer>
|
|
68
|
+
</Faq>
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
expect(screen.getByTestId('faq')).toHaveAttribute('data-kind', 'list')
|
|
72
|
+
expect(screen.getByTestId('question')).toHaveAttribute('data-kind', 'q')
|
|
73
|
+
expect(screen.getByTestId('answer')).toHaveAttribute('data-kind', 'a')
|
|
74
|
+
})
|
|
75
|
+
})
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
3
|
+
import { render, screen } from '@testing-library/react'
|
|
4
|
+
|
|
5
|
+
import { CardBody, LinkCard, LinkCardFooter, LinkCardHeader } from '../src'
|
|
6
|
+
|
|
7
|
+
describe('LinkCard', () => {
|
|
8
|
+
it('should render the title as a link', async () => {
|
|
9
|
+
render(
|
|
10
|
+
<LinkCard>
|
|
11
|
+
<LinkCardHeader as="h3" href="/readme">
|
|
12
|
+
Link-Card-Header
|
|
13
|
+
</LinkCardHeader>
|
|
14
|
+
<CardBody>Link-Card-Body</CardBody>
|
|
15
|
+
</LinkCard>
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
const link = screen.getByRole('link')
|
|
19
|
+
expect(link).toHaveAttribute('href', '/readme')
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it('should take the accessible name of the link from the title alone', async () => {
|
|
23
|
+
render(
|
|
24
|
+
<LinkCard>
|
|
25
|
+
<LinkCardHeader as="h3" href="/readme">
|
|
26
|
+
Link-Card-Header
|
|
27
|
+
</LinkCardHeader>
|
|
28
|
+
<CardBody>Link-Card-Body</CardBody>
|
|
29
|
+
<LinkCardFooter>June 27th, 2026</LinkCardFooter>
|
|
30
|
+
</LinkCard>
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
// Asserting the accessible name rather than the link text: when the anchor
|
|
34
|
+
// wrapped the whole card, the body and the footer were read out as part of
|
|
35
|
+
// the link name before it was announced as a link.
|
|
36
|
+
const link = screen.getByRole('link')
|
|
37
|
+
expect(link).toHaveAccessibleName('Link-Card-Header')
|
|
38
|
+
expect(link).not.toHaveAccessibleName(/Link-Card-Body/)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('should keep the title reachable by heading navigation', async () => {
|
|
42
|
+
render(
|
|
43
|
+
<LinkCard>
|
|
44
|
+
<LinkCardHeader as="h3" href="/readme">
|
|
45
|
+
Link-Card-Header
|
|
46
|
+
</LinkCardHeader>
|
|
47
|
+
</LinkCard>
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
expect(
|
|
51
|
+
screen.getByRole('heading', { level: 3, name: 'Link-Card-Header' })
|
|
52
|
+
).toBeInTheDocument()
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('should tell that the link opens in a new tab', async () => {
|
|
56
|
+
render(
|
|
57
|
+
<LinkCard>
|
|
58
|
+
<LinkCardHeader as="h3" href="https://example.com" target="_blank">
|
|
59
|
+
Link-Card-Header
|
|
60
|
+
</LinkCardHeader>
|
|
61
|
+
</LinkCard>
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
// The icon itself is aria-hidden, so without the alternative text the fact
|
|
65
|
+
// that the link opens elsewhere reached sighted users only.
|
|
66
|
+
expect(screen.getByRole('link')).toHaveAccessibleName(
|
|
67
|
+
/新しいタブで開きます/
|
|
68
|
+
)
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('should not tell about a new tab for a link that stays in the tab', async () => {
|
|
72
|
+
render(
|
|
73
|
+
<LinkCard>
|
|
74
|
+
<LinkCardHeader as="h3" href="/readme">
|
|
75
|
+
Link-Card-Header
|
|
76
|
+
</LinkCardHeader>
|
|
77
|
+
</LinkCard>
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
expect(screen.getByRole('link')).toHaveAccessibleName('Link-Card-Header')
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it('should render the link with the component given by linkAs', async () => {
|
|
84
|
+
const NextLinkLike = ({
|
|
85
|
+
to,
|
|
86
|
+
children,
|
|
87
|
+
...rest
|
|
88
|
+
}: { to: string; children: React.ReactNode }) => (
|
|
89
|
+
<a href={to} {...rest}>
|
|
90
|
+
{children}
|
|
91
|
+
</a>
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
render(
|
|
95
|
+
<LinkCard>
|
|
96
|
+
<LinkCardHeader as="h3" linkAs={NextLinkLike} to="/readme">
|
|
97
|
+
Link-Card-Header
|
|
98
|
+
</LinkCardHeader>
|
|
99
|
+
</LinkCard>
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
expect(screen.getByRole('link')).toHaveAttribute('href', '/readme')
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it('should pass unknown properties through to the link and the footer', async () => {
|
|
106
|
+
render(
|
|
107
|
+
<LinkCard data-testid="card">
|
|
108
|
+
<LinkCardHeader as="h3" href="/readme" data-kind="title">
|
|
109
|
+
Link-Card-Header
|
|
110
|
+
</LinkCardHeader>
|
|
111
|
+
<LinkCardFooter data-testid="footer" data-kind="meta">
|
|
112
|
+
June 27th, 2026
|
|
113
|
+
</LinkCardFooter>
|
|
114
|
+
</LinkCard>
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
// These used to be dropped: both components declared that they accept the
|
|
118
|
+
// properties of a div but never spread them onto an element.
|
|
119
|
+
expect(screen.getByRole('link')).toHaveAttribute('data-kind', 'title')
|
|
120
|
+
expect(screen.getByTestId('footer')).toHaveAttribute('data-kind', 'meta')
|
|
121
|
+
expect(screen.getByTestId('card')).toBeInTheDocument()
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('should say which property is missing when as is left out', async () => {
|
|
125
|
+
const Header = LinkCardHeader as unknown as React.ComponentType<{
|
|
126
|
+
href: string
|
|
127
|
+
children: React.ReactNode
|
|
128
|
+
}>
|
|
129
|
+
|
|
130
|
+
expect(() =>
|
|
131
|
+
render(
|
|
132
|
+
<LinkCard>
|
|
133
|
+
<Header href="/readme">Link-Card-Header</Header>
|
|
134
|
+
</LinkCard>
|
|
135
|
+
)
|
|
136
|
+
).toThrow(/LinkCardHeader: the "as" property is required/)
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
it('should pass an object to the ref property', async () => {
|
|
140
|
+
const ref = vi.fn()
|
|
141
|
+
render(
|
|
142
|
+
<LinkCard ref={ref}>
|
|
143
|
+
<LinkCardHeader as="h3" href="/readme">
|
|
144
|
+
Link-Card-Header
|
|
145
|
+
</LinkCardHeader>
|
|
146
|
+
</LinkCard>
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
expect(ref).toHaveBeenCalledTimes(1)
|
|
150
|
+
})
|
|
151
|
+
})
|
|
@@ -7,6 +7,6 @@ transforming...
|
|
|
7
7
|
[32m✓[39m 25 modules transformed.
|
|
8
8
|
rendering chunks...
|
|
9
9
|
computing gzip size...
|
|
10
|
-
[2mdist/[22m[36mindex.es.js [39m[1m[2m24.
|
|
11
|
-
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m16.
|
|
12
|
-
[32m✓ built in
|
|
10
|
+
[2mdist/[22m[36mindex.es.js [39m[1m[2m24.22 kB[22m[1m[22m[2m │ gzip: 6.09 kB[22m
|
|
11
|
+
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m16.80 kB[22m[1m[22m[2m │ gzip: 5.23 kB[22m
|
|
12
|
+
[32m✓ built in 482ms[39m
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react");var k={exports:{}},E={};var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react");var k={exports:{}},E={};var U;function ve(){if(U)return E;U=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function d(i,a,t){var o=null;if(t!==void 0&&(o=""+t),a.key!==void 0&&(o=""+a.key),"key"in a){t={};for(var u in a)u!=="key"&&(t[u]=a[u])}else t=a;return a=t.ref,{$$typeof:r,type:i,key:o,ref:a!==void 0?a:null,props:t}}return E.Fragment=n,E.jsx=d,E.jsxs=d,E}var _={};var B;function ye(){return B||(B=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case ie:return"Profiler";case ne:return"StrictMode";case fe:return"Suspense";case pe:return"SuspenseList";case xe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case oe:return"Portal";case ce:return e.displayName||"Context";case de:return(e._context.displayName||"Context")+".Consumer";case ue:var l=e.render;return e=e.displayName,e||(e=l.displayName||l.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case be:return l=e.displayName||null,l!==null?l:r(e.type)||"Memo";case P:l=e._payload,e=e._init;try{return r(e(l))}catch{}}return null}function n(e){return""+e}function d(e){try{n(e);var l=!1}catch{l=!0}if(l){l=console;var p=l.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return p.call(l,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),n(e)}}function i(e){if(e===C)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===P)return"<...>";try{var l=r(e);return l?"<"+l+">":"<...>"}catch{return"<...>"}}function a(){var e=S.A;return e===null?null:e.getOwner()}function t(){return Error("react-stack-top-frame")}function o(e){if(Y.call(e,"key")){var l=Object.getOwnPropertyDescriptor(e,"key").get;if(l&&l.isReactWarning)return!1}return e.key!==void 0}function u(e,l){function p(){z||(z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",l))}p.isReactWarning=!0,Object.defineProperty(e,"key",{get:p,configurable:!0})}function c(){var e=r(this.type);return D[e]||(D[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function m(e,l,p,b,I,A){var x=p.ref;return e={$$typeof:F,type:e,key:l,props:p,_owner:b},(x!==void 0?x:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:c}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function f(e,l,p,b,I,A){var x=l.children;if(x!==void 0)if(b)if(ge(x)){for(b=0;b<x.length;b++)g(x[b]);Object.freeze&&Object.freeze(x)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(x);if(Y.call(l,"key")){x=r(e);var j=Object.keys(l).filter(function(he){return he!=="key"});b=0<j.length?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}",G[x+b]||(j=0<j.length?"{"+j.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,b,x,j,x),
|
|
6
|
+
<%s key={someKey} {...props} />`,b,x,j,x),G[x+b]=!0)}if(x=null,p!==void 0&&(d(p),x=""+p),o(l)&&(d(l.key),x=""+l.key),"key"in l){p={};for(var $ in l)$!=="key"&&(p[$]=l[$])}else p=l;return x&&u(p,typeof e=="function"?e.displayName||e.name||"Unknown":e),m(e,x,p,a(),I,A)}function g(e){h(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===P&&(e._payload.status==="fulfilled"?h(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function h(e){return typeof e=="object"&&e!==null&&e.$$typeof===F}var v=R,F=Symbol.for("react.transitional.element"),oe=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),ne=Symbol.for("react.strict_mode"),ie=Symbol.for("react.profiler"),de=Symbol.for("react.consumer"),ce=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),be=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),xe=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),S=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,ge=Array.isArray,O=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(e){return e()}};var z,D={},L=v.react_stack_bottom_frame.bind(v,t)(),W=O(i(t)),G={};_.Fragment=C,_.jsx=function(e,l,p){var b=1e4>S.recentlyCreatedOwnerStacks++;return f(e,l,p,!1,b?Error("react-stack-top-frame"):L,b?O(i(e)):W)},_.jsxs=function(e,l,p){var b=1e4>S.recentlyCreatedOwnerStacks++;return f(e,l,p,!0,b?Error("react-stack-top-frame"):L,b?O(i(e)):W)}})()),_}var V;function Re(){return V||(V=1,process.env.NODE_ENV==="production"?k.exports=ve():k.exports=ye()),k.exports}var s=Re();const y=(...r)=>r.filter(Boolean).join(" ");var N;(r=>{r.clickable=`
|
|
7
7
|
px-2
|
|
8
8
|
min-h-[calc(44/16*1rem)]
|
|
9
9
|
border
|
|
10
10
|
border-transparent
|
|
11
11
|
rounded-lg
|
|
12
|
-
hover:bg-solid-
|
|
12
|
+
hover:bg-solid-gray-50
|
|
13
13
|
`,r.selected=`
|
|
14
14
|
rounded-full
|
|
15
15
|
bg-yellow-50
|
|
@@ -60,16 +60,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
60
60
|
shadow-1
|
|
61
61
|
rounded-lg
|
|
62
62
|
border
|
|
63
|
-
border-solid-
|
|
63
|
+
border-solid-gray-420
|
|
64
64
|
has-[>:nth-child(7)]:rounded-r-none
|
|
65
|
-
`,r.popoverPositionBottomRight=`
|
|
66
|
-
absolute
|
|
67
|
-
top-11
|
|
68
|
-
right-0
|
|
69
|
-
`,r.popoverPositionBottomLeft=`
|
|
70
|
-
absolute
|
|
71
|
-
top-11
|
|
72
|
-
left-0
|
|
73
65
|
`,(d=>{d.focus=`
|
|
74
66
|
peer-focus-visible:outline-4
|
|
75
67
|
peer-focus-visible:outline-black
|
|
@@ -126,7 +118,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
126
118
|
py-2
|
|
127
119
|
text-label
|
|
128
120
|
leading-snug
|
|
129
|
-
`},Q={lg:"w-[22px] h-[22px] mr-2",md:"w-[18px] h-[18px] mr-1.5",sm:"w-[18px] h-[18px] mr-1"},M=r=>{const{id:n,className:d,size:i="lg",children:
|
|
121
|
+
`},Q={lg:"w-[22px] h-[22px] mr-2",md:"w-[18px] h-[18px] mr-1.5",sm:"w-[18px] h-[18px] mr-1"},M=r=>{const{id:n,className:d,size:i="lg",children:a,...t}=r,o=R.useId(),u=n||o,c=R.useContext(T);c.isRequired&&(t.required=!0),c.groupName&&(t.name=c.groupName);const m={lg:22/24,md:18/24,sm:18/24},f=`
|
|
130
122
|
peer
|
|
131
123
|
sr-only
|
|
132
124
|
`,g=`
|
|
@@ -141,7 +133,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
141
133
|
peer-checked:border-none
|
|
142
134
|
peer-disabled:border-solid-gray-500
|
|
143
135
|
${N.Peer.focusRect}
|
|
144
|
-
`;return s.jsx("label",{htmlFor:u,className:y(X,Z[i],d),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:f,type:"checkbox","aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,...t}),s.jsx("span",{className:y(g,Q[i]),children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,width:"24",height:"24",viewBox:"0 0 24 24",children:s.jsx("g",{transform:`scale(${m[i]} ${m[i]})`,children:s.jsx("path",{d:"m9.55 17.65-5.325-5.325 1.05-1.075 4.275 4.275 9.175-9.175 1.05 1.075Z"})})})}),s.jsx("span",{className:"peer-disabled:text-solid-gray-500",children:
|
|
136
|
+
`;return s.jsx("label",{htmlFor:u,className:y(X,Z[i],d),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:f,type:"checkbox","aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,...t}),s.jsx("span",{className:y(g,Q[i]),children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,width:"24",height:"24",viewBox:"0 0 24 24",children:s.jsx("g",{transform:`scale(${m[i]} ${m[i]})`,children:s.jsx("path",{d:"m9.55 17.65-5.325-5.325 1.05-1.075 4.275 4.275 9.175-9.175 1.05 1.075Z"})})})}),s.jsx("span",{className:"peer-disabled:text-solid-gray-500",children:a})]})})};M.displayName="Checkbox";const q=r=>{const{id:n,className:d,size:i="lg",children:a,...t}=r,o=R.useId(),u=n||o,c=R.useContext(T);c.isRequired&&(t.required=!0),c.groupName&&(t.name=c.groupName);const m=`
|
|
145
137
|
peer
|
|
146
138
|
sr-only
|
|
147
139
|
`,f=`
|
|
@@ -154,12 +146,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
154
146
|
peer-checked:border-blue-600
|
|
155
147
|
peer-disabled:border-solid-gray-500
|
|
156
148
|
${N.Peer.focusRect}
|
|
157
|
-
`,g={lg:"p-1",md:"p-[3px]",sm:"p-[3px]"};return s.jsx("label",{htmlFor:u,className:y(X,Z[i],d),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:m,type:"radio","aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,...t}),s.jsx("span",{"aria-hidden":!0,className:y(f,g[i],Q[i])}),s.jsx("span",{className:"peer-disabled:text-solid-gray-500",children:
|
|
149
|
+
`,g={lg:"p-1",md:"p-[3px]",sm:"p-[3px]"};return s.jsx("label",{htmlFor:u,className:y(X,Z[i],d),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:m,type:"radio","aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,...t}),s.jsx("span",{"aria-hidden":!0,className:y(f,g[i],Q[i])}),s.jsx("span",{className:"peer-disabled:text-solid-gray-500",children:a})]})})};q.displayName="Radio";const K=r=>{const{id:n,className:d,size:i="lg",children:a,...t}=r,o=R.useContext(T);return o.isRequired&&(t.required=!0),s.jsxs("div",{className:"inline-block relative",children:[s.jsx("select",{id:n||o.id,className:y(`
|
|
158
150
|
!pr-8
|
|
159
151
|
peer
|
|
160
152
|
cursor-pointer
|
|
161
153
|
appearance-none
|
|
162
|
-
`,J,H[i],d),"aria-describedby":
|
|
154
|
+
`,J,H[i],d),"aria-describedby":o.helperTextId,"aria-errormessage":o.errorMessageId,"aria-invalid":o.isInvalid??!1,...t,children:a}),s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:`
|
|
163
155
|
pointer-events-none
|
|
164
156
|
absolute
|
|
165
157
|
right-4
|
|
@@ -167,7 +159,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
167
159
|
-translate-y-1/2
|
|
168
160
|
text-solid-gray-900
|
|
169
161
|
peer-disabled:text-solid-gray-500
|
|
170
|
-
`,fill:"none",width:"16",height:"16",viewBox:"0 0 16 16",children:[s.jsx("title",{children:"arrow down"}),s.jsx("path",{d:"M12 15.05 6.35 9.4 7.4 8.35l4.6 4.6 4.6-4.6 1.05 1.05Z",fill:"currentColor"})]})]})};K.displayName="Select";const ee=r=>{const{id:n,className:d,size:i="lg",...
|
|
162
|
+
`,fill:"none",width:"16",height:"16",viewBox:"0 0 16 16",children:[s.jsx("title",{children:"arrow down"}),s.jsx("path",{d:"M12 15.05 6.35 9.4 7.4 8.35l4.6 4.6 4.6-4.6 1.05 1.05Z",fill:"currentColor"})]})]})};K.displayName="Select";const ee=r=>{const{id:n,className:d,size:i="lg",...a}=r,t=R.useContext(T);t.isRequired&&(a.required=!0);const o=`
|
|
171
163
|
file:mr-2
|
|
172
164
|
file:inline-block
|
|
173
165
|
file:text-button
|
|
@@ -217,7 +209,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
217
209
|
file:text-button
|
|
218
210
|
file:rounded-md
|
|
219
211
|
file:leading-snug
|
|
220
|
-
`};return s.jsx("input",{type:"file",id:n||t.id,className:y(
|
|
212
|
+
`};return s.jsx("input",{type:"file",id:n||t.id,className:y(o,u,m[i],c,d),"aria-describedby":t.helperTextId,"aria-errormessage":t.errorMessageId,"aria-invalid":t.isInvalid??!1,...a})};ee.displayName="FileInput";const re=r=>{const{id:n,className:d,size:i="lg",...a}=r,t=R.useContext(T);return t.isRequired&&(a.required=!0),s.jsx("input",{type:"text",id:n||t.id,className:y(J,H[i],d),"aria-describedby":t.helperTextId,"aria-errormessage":t.errorMessageId,"aria-invalid":t.isInvalid??!1,...a})};re.displayName="Input";const te=r=>{const{id:n,className:d,children:i,onChange:a,maxLength:t,...o}=r,[u,c]=R.useState(0),m=v=>{a&&a(v),c(v.target.value.length)},f=R.useContext(T);f.isRequired&&(o.required=!0);const g=u>(t||0)?"text-red-800":"text-solid-gray-700",h=`
|
|
221
213
|
p-4
|
|
222
214
|
text-label
|
|
223
215
|
rounded-lg
|
|
@@ -229,8 +221,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
229
221
|
disabled:border-solid-gray-500
|
|
230
222
|
aria-invalid:border-red-800
|
|
231
223
|
${N.focusRect}
|
|
232
|
-
`;return s.jsxs(s.Fragment,{children:[s.jsx("textarea",{id:n||f.id,className:y(h,d),"aria-describedby":f.helperTextId,"aria-errormessage":f.errorMessageId,"aria-invalid":f.isInvalid??!1,onChange:m,...
|
|
224
|
+
`;return s.jsxs(s.Fragment,{children:[s.jsx("textarea",{id:n||f.id,className:y(h,d),"aria-describedby":f.helperTextId,"aria-errormessage":f.errorMessageId,"aria-invalid":f.isInvalid??!1,onChange:m,...o,children:i}),t?s.jsxs("p",{className:"text-label text-solid-gray-700",children:[s.jsx("span",{className:g,children:u}),"/",s.jsx("span",{children:t})]}):""]})};te.displayName="Textarea";const se=r=>{const n=R.useId(),{labelText:d,className:i,helperText:a,errorMessage:t,isInvalid:o,isRequired:u,children:c,...m}=r,f={id:r.htmlFor??`input-${n}`,helperTextId:`helper-text-${n}`,errorMessageId:`error-message-${n}`,isInvalid:o??!1,isRequired:u??!1};return s.jsx(T.Provider,{value:f,children:s.jsxs("div",{className:y("flex flex-col items-start gap-2",i),children:[s.jsxs("label",{className:y("block text-label",o&&"text-red-800"),htmlFor:f.id,...m,children:[d,u&&s.jsx("span",{className:"text-label text-red-800",children:" *"})]}),a&&s.jsx("p",{id:f.helperTextId,className:`
|
|
233
225
|
text-label text-solid-gray-700
|
|
234
|
-
`,children:
|
|
226
|
+
`,children:a}),c,o&&s.jsx("p",{id:f.errorMessageId,className:`
|
|
235
227
|
text-label text-red-800
|
|
236
|
-
`,children:t})]})})};se.displayName="LabelControl";const w=r=>{const n=R.useId(),{labelText:d,className:i,helperText:
|
|
228
|
+
`,children:t})]})})};se.displayName="LabelControl";const w=r=>{const n=R.useId(),{labelText:d,className:i,helperText:a,errorMessage:t,isInvalid:o,isRequired:u,direction:c,children:m,...f}=r,h={groupName:f.name??`group-${n}`,helperTextId:`helper-text-${n}`,errorMessageId:`error-message-${n}`,isInvalid:o??!1,isRequired:u??!1},v=c??"flex-col";return s.jsx(T.Provider,{value:h,children:s.jsxs("fieldset",{className:y("flex flex-col items-start gap-2",i),...f,children:[s.jsx("legend",{children:s.jsxs("p",{className:y("block text-label",o&&"text-red-800"),children:[d,u&&s.jsx("span",{className:"text-red-800",children:" *"})]})}),s.jsx("div",{className:y("inline-flex",v),children:m}),a&&s.jsx("p",{id:h.helperTextId,className:"text-sup text-solid-gray-700",children:a}),o&&s.jsx("p",{id:h.errorMessageId,className:"text-label text-red-800",children:t})]})})};w.displayName="FieldsetControl";const le=r=>{const{items:n,onChange:d,className:i,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:c,size:m,...f}=r;return s.jsx(w,{className:i,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:c,...f,children:n.map(({label:g,value:h})=>s.jsx(M,{size:m,value:h,onChange:d,children:g},`${g}-${h}`))})};le.displayName="CheckboxGroup";const ae=r=>{const{items:n,onChange:d,className:i,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:c,defaultValue:m,size:f,...g}=r;return s.jsx(w,{className:i,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:c,...g,children:n.map(({label:h,value:v})=>s.jsx(q,{size:f,value:v,onChange:d,defaultChecked:m===v,children:h},`${h}-${v}`))})};ae.displayName="RadioGroup";exports.Checkbox=M;exports.CheckboxGroup=le;exports.FieldsetControl=w;exports.FileInput=ee;exports.Input=re;exports.LabelControl=se;exports.Radio=q;exports.RadioGroup=ae;exports.Select=K;exports.Textarea=te;
|