@a-type/ui 6.1.16 → 6.1.18
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/button/ConfirmedButton.js +2 -2
- package/dist/components/button/ConfirmedButton.js.map +1 -1
- package/dist/components/datePicker/DatePicker.d.ts +1 -1
- package/dist/components/datePicker/DatePicker.stories.d.ts +1 -1
- package/dist/components/datePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/datePicker/DateRangePicker.js +15 -1
- package/dist/components/datePicker/DateRangePicker.js.map +1 -1
- package/dist/components/dialog/Dialog.d.ts +20 -34
- package/dist/components/dialog/Dialog.js +47 -208
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/Dialog.module.css +10 -82
- package/dist/components/dialog/Dialog.stories.js +8 -7
- package/dist/components/dialog/Dialog.stories.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +25 -0
- package/dist/components/drawer/Drawer.js +102 -0
- package/dist/components/drawer/Drawer.js.map +1 -0
- package/dist/components/drawer/Drawer.module.css +182 -0
- package/dist/components/drawer/Drawer.stories.d.ts +7 -0
- package/dist/components/drawer/Drawer.stories.js +27 -0
- package/dist/components/drawer/Drawer.stories.js.map +1 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/withContextVariant.d.ts +8 -0
- package/dist/hooks/withContextVariant.js +21 -0
- package/dist/hooks/withContextVariant.js.map +1 -0
- package/package.json +2 -2
- package/src/components/button/ConfirmedButton.tsx +9 -16
- package/src/components/datePicker/DateRangePicker.tsx +18 -1
- package/src/components/dialog/Dialog.module.css +10 -82
- package/src/components/dialog/Dialog.stories.tsx +45 -51
- package/src/components/dialog/Dialog.tsx +98 -332
- package/src/components/drawer/Drawer.module.css +181 -0
- package/src/components/drawer/Drawer.stories.tsx +68 -0
- package/src/components/drawer/Drawer.tsx +204 -0
- package/src/components/drawer/index.ts +1 -0
- package/src/components/index.ts +1 -0
- package/src/hooks/withContextVariant.tsx +24 -0
|
@@ -24,10 +24,9 @@
|
|
|
24
24
|
align-items: stretch;
|
|
25
25
|
overflow: clip;
|
|
26
26
|
transition: all var(--m-dur) var(--m-ease);
|
|
27
|
-
--shadow-dir: 1;
|
|
28
27
|
@apply --mx-shadow;
|
|
29
|
-
--mx-shadow-value: 0
|
|
30
|
-
var(--m-shadow-lg-
|
|
28
|
+
--mx-shadow-value: 0 var(--m-shadow-lg-y) var(--m-shadow-lg-blur)
|
|
29
|
+
var(--m-shadow-lg-spread) var(--m-shadow-lg-color);
|
|
31
30
|
@apply --mx-bg(var(--m-surface-ambient-bg));
|
|
32
31
|
@apply --mx-borderColor(var(--m-gray-heavy));
|
|
33
32
|
|
|
@@ -46,55 +45,14 @@
|
|
|
46
45
|
transform: translate3d(-50%, -45%, 0) scale(0.95);
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
height: min-content;
|
|
58
|
-
width: 100vw;
|
|
59
|
-
border-radius: var(--m-surface-rd) var(--m-surface-rd) 0 0;
|
|
60
|
-
border-bottom-width: 0;
|
|
61
|
-
transform: translate(0, 0);
|
|
62
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
63
|
-
padding-top: var(--m-sp-lg);
|
|
64
|
-
|
|
65
|
-
&[data-starting-style],
|
|
66
|
-
&[data-ending-style] {
|
|
67
|
-
opacity: 0;
|
|
68
|
-
transform: translate3d(0, 100%, 0) scale(0.98);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&[data-width='lg'] {
|
|
72
|
-
max-width: 800px;
|
|
73
|
-
}
|
|
74
|
-
&[data-width='md'] {
|
|
75
|
-
max-width: 600px;
|
|
76
|
-
}
|
|
77
|
-
&[data-width='sm'] {
|
|
78
|
-
max-width: 300px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&[data-keyboard-behavior='overlay'] {
|
|
82
|
-
bottom: calc(
|
|
83
|
-
var(--mock-virtual-keyboard-height, env(keyboard-inset-height, 0px)) +
|
|
84
|
-
var(--gesture-y, 0px)
|
|
85
|
-
);
|
|
86
|
-
max-height: calc(
|
|
87
|
-
95vh -
|
|
88
|
-
var(--mock-virtual-keyboard-height, env(keyboard-inset-height, 0px))
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
&[data-keyboard-behavior='displace'] {
|
|
92
|
-
bottom: calc(
|
|
93
|
-
var(--viewport-bottom-offset, 0px) + var(--gesture-y, 0px)
|
|
94
|
-
);
|
|
95
|
-
max-height: calc(0.85 * var(--viewport-height, 100vh));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
48
|
+
&[data-width='lg'] {
|
|
49
|
+
max-width: 800px;
|
|
50
|
+
}
|
|
51
|
+
&[data-width='md'] {
|
|
52
|
+
max-width: 600px;
|
|
53
|
+
}
|
|
54
|
+
&[data-width='sm'] {
|
|
55
|
+
max-width: 300px;
|
|
98
56
|
}
|
|
99
57
|
}
|
|
100
58
|
|
|
@@ -110,42 +68,12 @@
|
|
|
110
68
|
padding: var(--m-surface-p);
|
|
111
69
|
}
|
|
112
70
|
|
|
113
|
-
.swipeHandle {
|
|
114
|
-
display: block;
|
|
115
|
-
position: absolute;
|
|
116
|
-
top: 0;
|
|
117
|
-
left: 50%;
|
|
118
|
-
transform: translateX(-50%) scale(1);
|
|
119
|
-
width: 20%;
|
|
120
|
-
cursor: grab;
|
|
121
|
-
will-change: transform;
|
|
122
|
-
touch-action: none;
|
|
123
|
-
padding-block: var(--m-sp-sm);
|
|
124
|
-
z-index: 1;
|
|
125
|
-
|
|
126
|
-
@media (min-width: 600px) {
|
|
127
|
-
display: none;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
.swipeHandleBar {
|
|
131
|
-
height: 4px;
|
|
132
|
-
width: 100%;
|
|
133
|
-
@apply --mx-bg(var(--m-gray));
|
|
134
|
-
border-radius: var(--m-rd-lg);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
71
|
.close {
|
|
138
72
|
position: absolute;
|
|
139
73
|
right: var(--m-sp-sm);
|
|
140
74
|
top: var(--m-sp-sm);
|
|
141
75
|
z-index: 101;
|
|
142
76
|
display: flex;
|
|
143
|
-
|
|
144
|
-
&[data-show-on-mobile='false'] {
|
|
145
|
-
@media (max-width: 600px) {
|
|
146
|
-
display: none;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
77
|
}
|
|
150
78
|
|
|
151
79
|
.title {
|
|
@@ -8,14 +8,7 @@ import { Provider } from '../provider/Provider.js';
|
|
|
8
8
|
import { Select } from '../select/index.js';
|
|
9
9
|
import { Tooltip } from '../tooltip/Tooltip.js';
|
|
10
10
|
import { H1, P } from '../typography/index.js';
|
|
11
|
-
import {
|
|
12
|
-
Dialog,
|
|
13
|
-
DialogActions,
|
|
14
|
-
DialogClose,
|
|
15
|
-
DialogContent,
|
|
16
|
-
DialogTitle,
|
|
17
|
-
DialogTrigger,
|
|
18
|
-
} from './Dialog.js';
|
|
11
|
+
import { Dialog } from './Dialog.js';
|
|
19
12
|
|
|
20
13
|
const meta: any = {
|
|
21
14
|
title: 'Components/Dialog',
|
|
@@ -65,10 +58,10 @@ export const Default: Story = {
|
|
|
65
58
|
args: {
|
|
66
59
|
children: (
|
|
67
60
|
<ParticleLayer noPortal>
|
|
68
|
-
<
|
|
61
|
+
<Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
|
|
69
62
|
<DummyContent />
|
|
70
|
-
<
|
|
71
|
-
<
|
|
63
|
+
<Dialog.Content>
|
|
64
|
+
<Dialog.Title>Hello world</Dialog.Title>
|
|
72
65
|
<DummyContent />
|
|
73
66
|
<DummyContent />
|
|
74
67
|
<DummyContent />
|
|
@@ -76,11 +69,11 @@ export const Default: Story = {
|
|
|
76
69
|
<Input placeholder="Type something..." />
|
|
77
70
|
<Button emphasis="primary">Submit</Button>
|
|
78
71
|
</Box>
|
|
79
|
-
<
|
|
80
|
-
<
|
|
72
|
+
<Dialog.Actions>
|
|
73
|
+
<Dialog.Close />
|
|
81
74
|
<Button emphasis="primary">Accept</Button>
|
|
82
|
-
</
|
|
83
|
-
</
|
|
75
|
+
</Dialog.Actions>
|
|
76
|
+
</Dialog.Content>
|
|
84
77
|
</ParticleLayer>
|
|
85
78
|
),
|
|
86
79
|
},
|
|
@@ -90,15 +83,15 @@ export const Small: Story = {
|
|
|
90
83
|
args: {
|
|
91
84
|
children: (
|
|
92
85
|
<ParticleLayer noPortal>
|
|
93
|
-
<
|
|
86
|
+
<Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
|
|
94
87
|
<DummyContent />
|
|
95
|
-
<
|
|
96
|
-
<
|
|
88
|
+
<Dialog.Content>
|
|
89
|
+
<Dialog.Title>Hello world</Dialog.Title>
|
|
97
90
|
<DummyContent />
|
|
98
|
-
<
|
|
99
|
-
<
|
|
100
|
-
</
|
|
101
|
-
</
|
|
91
|
+
<Dialog.Actions>
|
|
92
|
+
<Dialog.Close />
|
|
93
|
+
</Dialog.Actions>
|
|
94
|
+
</Dialog.Content>
|
|
102
95
|
</ParticleLayer>
|
|
103
96
|
),
|
|
104
97
|
},
|
|
@@ -106,16 +99,17 @@ export const Small: Story = {
|
|
|
106
99
|
|
|
107
100
|
export const NoSheet: Story = {
|
|
108
101
|
args: {
|
|
102
|
+
disableSheet: true,
|
|
109
103
|
children: (
|
|
110
104
|
<ParticleLayer noPortal>
|
|
111
|
-
<
|
|
105
|
+
<Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
|
|
112
106
|
<DummyContent />
|
|
113
|
-
<
|
|
114
|
-
<
|
|
115
|
-
<
|
|
116
|
-
<
|
|
117
|
-
</
|
|
118
|
-
</
|
|
107
|
+
<Dialog.Content>
|
|
108
|
+
<Dialog.Title>Hello world</Dialog.Title>
|
|
109
|
+
<Dialog.Actions>
|
|
110
|
+
<Dialog.Close />
|
|
111
|
+
</Dialog.Actions>
|
|
112
|
+
</Dialog.Content>
|
|
119
113
|
</ParticleLayer>
|
|
120
114
|
),
|
|
121
115
|
},
|
|
@@ -125,14 +119,14 @@ export const Positioned: Story = {
|
|
|
125
119
|
args: {
|
|
126
120
|
children: (
|
|
127
121
|
<ParticleLayer noPortal>
|
|
128
|
-
<
|
|
122
|
+
<Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
|
|
129
123
|
<DummyContent />
|
|
130
|
-
<
|
|
131
|
-
<
|
|
132
|
-
<
|
|
133
|
-
<
|
|
134
|
-
</
|
|
135
|
-
</
|
|
124
|
+
<Dialog.Content style={{ bottom: 0, top: 'auto' }}>
|
|
125
|
+
<Dialog.Title>Hello world</Dialog.Title>
|
|
126
|
+
<Dialog.Actions>
|
|
127
|
+
<Dialog.Close />
|
|
128
|
+
</Dialog.Actions>
|
|
129
|
+
</Dialog.Content>
|
|
136
130
|
</ParticleLayer>
|
|
137
131
|
),
|
|
138
132
|
},
|
|
@@ -156,18 +150,18 @@ export const VirtualKeyboard: Story = {
|
|
|
156
150
|
return (
|
|
157
151
|
<Provider virtualKeyboardBehavior="overlay">
|
|
158
152
|
<Dialog>
|
|
159
|
-
<
|
|
153
|
+
<Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
|
|
160
154
|
<DummyContent />
|
|
161
|
-
<
|
|
162
|
-
<
|
|
155
|
+
<Dialog.Content>
|
|
156
|
+
<Dialog.Title>Hello world</Dialog.Title>
|
|
163
157
|
<Input />
|
|
164
|
-
<
|
|
165
|
-
<
|
|
158
|
+
<Dialog.Actions>
|
|
159
|
+
<Dialog.Close />
|
|
166
160
|
<Button onClick={() => setKeyboard((v) => !v)}>
|
|
167
161
|
Toggle fake kb
|
|
168
162
|
</Button>
|
|
169
|
-
</
|
|
170
|
-
</
|
|
163
|
+
</Dialog.Actions>
|
|
164
|
+
</Dialog.Content>
|
|
171
165
|
</Dialog>
|
|
172
166
|
<div
|
|
173
167
|
className="bg-neutral-ink"
|
|
@@ -190,9 +184,9 @@ export const MultiNested: Story = {
|
|
|
190
184
|
render() {
|
|
191
185
|
return (
|
|
192
186
|
<Dialog>
|
|
193
|
-
<
|
|
194
|
-
<
|
|
195
|
-
<
|
|
187
|
+
<Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
|
|
188
|
+
<Dialog.Content>
|
|
189
|
+
<Dialog.Title>Hello world</Dialog.Title>
|
|
196
190
|
<DummyContent />
|
|
197
191
|
<Select value="">
|
|
198
192
|
<Select.Trigger>
|
|
@@ -206,17 +200,17 @@ export const MultiNested: Story = {
|
|
|
206
200
|
</Select.Content>
|
|
207
201
|
</Select>
|
|
208
202
|
<Dialog>
|
|
209
|
-
<
|
|
210
|
-
<
|
|
211
|
-
<
|
|
203
|
+
<Dialog.Trigger render={<Button />}>Open nested</Dialog.Trigger>
|
|
204
|
+
<Dialog.Content>
|
|
205
|
+
<Dialog.Title>Nested dialog</Dialog.Title>
|
|
212
206
|
<Tooltip content="This is a tooltip">
|
|
213
207
|
<Button>Hover me</Button>
|
|
214
208
|
</Tooltip>
|
|
215
209
|
<DummyContent />
|
|
216
210
|
<DummyContent />
|
|
217
|
-
</
|
|
211
|
+
</Dialog.Content>
|
|
218
212
|
</Dialog>
|
|
219
|
-
</
|
|
213
|
+
</Dialog.Content>
|
|
220
214
|
</Dialog>
|
|
221
215
|
);
|
|
222
216
|
},
|