@a-type/ui 6.1.15 → 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.
Files changed (43) hide show
  1. package/dist/components/button/ConfirmedButton.js +2 -2
  2. package/dist/components/button/ConfirmedButton.js.map +1 -1
  3. package/dist/components/datePicker/Calendar.module.css +5 -1
  4. package/dist/components/datePicker/DatePicker.d.ts +1 -1
  5. package/dist/components/datePicker/DatePicker.stories.d.ts +1 -1
  6. package/dist/components/datePicker/DateRangePicker.d.ts +1 -1
  7. package/dist/components/datePicker/DateRangePicker.js +13 -3
  8. package/dist/components/datePicker/DateRangePicker.js.map +1 -1
  9. package/dist/components/dialog/Dialog.d.ts +20 -34
  10. package/dist/components/dialog/Dialog.js +47 -208
  11. package/dist/components/dialog/Dialog.js.map +1 -1
  12. package/dist/components/dialog/Dialog.module.css +10 -82
  13. package/dist/components/dialog/Dialog.stories.js +8 -7
  14. package/dist/components/dialog/Dialog.stories.js.map +1 -1
  15. package/dist/components/drawer/Drawer.d.ts +25 -0
  16. package/dist/components/drawer/Drawer.js +102 -0
  17. package/dist/components/drawer/Drawer.js.map +1 -0
  18. package/dist/components/drawer/Drawer.module.css +182 -0
  19. package/dist/components/drawer/Drawer.stories.d.ts +7 -0
  20. package/dist/components/drawer/Drawer.stories.js +27 -0
  21. package/dist/components/drawer/Drawer.stories.js.map +1 -0
  22. package/dist/components/drawer/index.d.ts +1 -0
  23. package/dist/components/drawer/index.js +2 -0
  24. package/dist/components/drawer/index.js.map +1 -0
  25. package/dist/components/index.d.ts +1 -0
  26. package/dist/components/index.js +1 -0
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/hooks/withContextVariant.d.ts +8 -0
  29. package/dist/hooks/withContextVariant.js +21 -0
  30. package/dist/hooks/withContextVariant.js.map +1 -0
  31. package/package.json +2 -2
  32. package/src/components/button/ConfirmedButton.tsx +9 -16
  33. package/src/components/datePicker/Calendar.module.css +5 -1
  34. package/src/components/datePicker/DateRangePicker.tsx +16 -3
  35. package/src/components/dialog/Dialog.module.css +10 -82
  36. package/src/components/dialog/Dialog.stories.tsx +45 -51
  37. package/src/components/dialog/Dialog.tsx +98 -332
  38. package/src/components/drawer/Drawer.module.css +181 -0
  39. package/src/components/drawer/Drawer.stories.tsx +68 -0
  40. package/src/components/drawer/Drawer.tsx +204 -0
  41. package/src/components/drawer/index.ts +1 -0
  42. package/src/components/index.ts +1 -0
  43. 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 calc(var(--shadow-dir, 1) * var(--m-shadow-lg-y))
30
- var(--m-shadow-lg-blur) var(--m-shadow-lg-spread) var(--m-shadow-lg-color);
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
- &:not([data-disable-sheet='true']) {
50
- @media (max-width: 600px) {
51
- --shadow-dir: -1;
52
- top: auto;
53
- bottom: 0;
54
- left: 0;
55
- right: 0;
56
- max-width: unset;
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
- <DialogTrigger render={<Button />}>Open</DialogTrigger>
61
+ <Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
69
62
  <DummyContent />
70
- <DialogContent>
71
- <DialogTitle>Hello world</DialogTitle>
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
- <DialogActions>
80
- <DialogClose />
72
+ <Dialog.Actions>
73
+ <Dialog.Close />
81
74
  <Button emphasis="primary">Accept</Button>
82
- </DialogActions>
83
- </DialogContent>
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
- <DialogTrigger render={<Button />}>Open</DialogTrigger>
86
+ <Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
94
87
  <DummyContent />
95
- <DialogContent>
96
- <DialogTitle>Hello world</DialogTitle>
88
+ <Dialog.Content>
89
+ <Dialog.Title>Hello world</Dialog.Title>
97
90
  <DummyContent />
98
- <DialogActions>
99
- <DialogClose />
100
- </DialogActions>
101
- </DialogContent>
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
- <DialogTrigger render={<Button />}>Open</DialogTrigger>
105
+ <Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
112
106
  <DummyContent />
113
- <DialogContent disableSheet>
114
- <DialogTitle>Hello world</DialogTitle>
115
- <DialogActions>
116
- <DialogClose />
117
- </DialogActions>
118
- </DialogContent>
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
- <DialogTrigger render={<Button />}>Open</DialogTrigger>
122
+ <Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
129
123
  <DummyContent />
130
- <DialogContent style={{ bottom: 0, top: 'auto' }}>
131
- <DialogTitle>Hello world</DialogTitle>
132
- <DialogActions>
133
- <DialogClose />
134
- </DialogActions>
135
- </DialogContent>
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
- <DialogTrigger render={<Button />}>Open</DialogTrigger>
153
+ <Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
160
154
  <DummyContent />
161
- <DialogContent>
162
- <DialogTitle>Hello world</DialogTitle>
155
+ <Dialog.Content>
156
+ <Dialog.Title>Hello world</Dialog.Title>
163
157
  <Input />
164
- <DialogActions>
165
- <DialogClose />
158
+ <Dialog.Actions>
159
+ <Dialog.Close />
166
160
  <Button onClick={() => setKeyboard((v) => !v)}>
167
161
  Toggle fake kb
168
162
  </Button>
169
- </DialogActions>
170
- </DialogContent>
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
- <DialogTrigger render={<Button />}>Open</DialogTrigger>
194
- <DialogContent>
195
- <DialogTitle>Hello world</DialogTitle>
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
- <DialogTrigger render={<Button />}>Open nested</DialogTrigger>
210
- <DialogContent>
211
- <DialogTitle>Nested dialog</DialogTitle>
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
- </DialogContent>
211
+ </Dialog.Content>
218
212
  </Dialog>
219
- </DialogContent>
213
+ </Dialog.Content>
220
214
  </Dialog>
221
215
  );
222
216
  },