@popsure/dirty-swan 0.59.0-beta → 0.59.0-beta-3

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 (53) hide show
  1. package/dist/cjs/index.js +15 -15
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/lib/components/button/index.d.ts +1 -1
  4. package/dist/esm/{Calendar-2d7e51b5.js → Calendar-5ad3eccf.js} +2 -2
  5. package/dist/esm/Calendar-5ad3eccf.js.map +1 -0
  6. package/dist/esm/{TableSection-3a883ecb.js → TableSection-018d8e8f.js} +1 -1
  7. package/dist/esm/{TableSection-3a883ecb.js.map → TableSection-018d8e8f.js.map} +1 -1
  8. package/dist/esm/components/accordion/index.js +2 -2
  9. package/dist/esm/components/accordion/index.js.map +1 -1
  10. package/dist/esm/components/button/index.js +4 -5
  11. package/dist/esm/components/button/index.js.map +1 -1
  12. package/dist/esm/components/button/index.stories.js +3 -7
  13. package/dist/esm/components/button/index.stories.js.map +1 -1
  14. package/dist/esm/components/comparisonTable/components/TableArrows/index.js +1 -1
  15. package/dist/esm/components/dateSelector/components/Calendar.js +1 -1
  16. package/dist/esm/components/dateSelector/index.js +1 -1
  17. package/dist/esm/components/dateSelector/index.stories.js +1 -1
  18. package/dist/esm/components/dateSelector/index.test.js +1 -1
  19. package/dist/esm/components/input/index.js +1 -1
  20. package/dist/esm/components/modal/genericModal/index.js +1 -1
  21. package/dist/esm/components/modal/genericModal/index.js.map +1 -1
  22. package/dist/esm/components/modal/index.stories.js +7 -7
  23. package/dist/esm/components/modal/index.stories.js.map +1 -1
  24. package/dist/esm/components/segmentedControl/index.js +1 -1
  25. package/dist/esm/components/table/Table.js +1 -1
  26. package/dist/esm/components/table/Table.stories.js +1 -1
  27. package/dist/esm/components/table/Table.test.js +1 -1
  28. package/dist/esm/components/table/components/TableContents/TableContents.js +1 -1
  29. package/dist/esm/components/table/components/TableContents/TableContents.test.js +1 -1
  30. package/dist/esm/components/table/components/TableControls/TableControls.js +4 -3
  31. package/dist/esm/components/table/components/TableControls/TableControls.js.map +1 -1
  32. package/dist/esm/components/table/components/TableSection/TableSection.js +1 -1
  33. package/dist/esm/components/table/components/TableSection/TableSection.test.js +1 -1
  34. package/dist/esm/index.js +2 -2
  35. package/dist/esm/lib/components/button/index.d.ts +1 -1
  36. package/dist/index.css +88 -55
  37. package/dist/index.css.map +1 -1
  38. package/dist/lib/scss/private/components/_buttons.scss +105 -63
  39. package/package.json +1 -1
  40. package/src/lib/components/accordion/index.tsx +1 -0
  41. package/src/lib/components/accordion/style.module.scss +0 -4
  42. package/src/lib/components/button/index.stories.tsx +22 -57
  43. package/src/lib/components/button/index.tsx +7 -9
  44. package/src/lib/components/comparisonTable/components/TableArrows/style.module.scss +1 -0
  45. package/src/lib/components/dateSelector/components/Calendar.tsx +1 -1
  46. package/src/lib/components/input/style.module.scss +1 -1
  47. package/src/lib/components/modal/genericModal/index.tsx +1 -1
  48. package/src/lib/components/modal/index.stories.tsx +38 -38
  49. package/src/lib/components/segmentedControl/style.module.scss +1 -1
  50. package/src/lib/components/table/components/TableControls/TableControls.module.scss +6 -1
  51. package/src/lib/components/table/components/TableControls/TableControls.tsx +10 -2
  52. package/src/lib/scss/private/components/_buttons.scss +105 -63
  53. package/dist/esm/Calendar-2d7e51b5.js.map +0 -1
@@ -106,12 +106,12 @@ export const BottomOrRegularModalStory = ({
106
106
 
107
107
  return (
108
108
  <>
109
- <button
110
- className="d-flex p-btn--primary wmn2"
109
+ <Button
110
+ className="wmn2"
111
111
  onClick={() => setDisplay(true)}
112
112
  >
113
113
  Click to open modal
114
- </button>
114
+ </Button>
115
115
 
116
116
  <BottomOrRegularModal
117
117
  dismissible={dismissible}
@@ -125,12 +125,12 @@ export const BottomOrRegularModalStory = ({
125
125
  >
126
126
  <div style={{ padding: '0 24px 24px 24px' }}>
127
127
  <div>{children}</div>
128
- <button
129
- className="p-btn--primary mt24 wmn3"
128
+ <Button
129
+ className="mt24 wmn3"
130
130
  onClick={() => setDisplay(false)}
131
131
  >
132
132
  Continue
133
- </button>
133
+ </Button>
134
134
  </div>
135
135
  </BottomOrRegularModal>
136
136
  </>
@@ -159,21 +159,21 @@ export const RegularModalStory = ({
159
159
  to use it for Mobile only, you should check BottomModal instead. Want to
160
160
  use either Regular Modal or Bottom Modal based on the screen width? You
161
161
  can use Bottom or Regular modal.
162
- <button
163
- className="d-flex p-btn--primary wmn2 mt24"
162
+ <Button
163
+ className="wmn2 mt24"
164
164
  onClick={() => setDisplay(true)}
165
165
  >
166
166
  Click to open modal
167
- </button>
167
+ </Button>
168
168
  <RegularModal title={title} isOpen={display} onClose={handleOnClose}>
169
169
  <div style={{ padding: '0 24px 24px 24px' }}>
170
170
  <div>{children}</div>
171
- <button
172
- className="p-btn--primary mt24 wmn3"
171
+ <Button
172
+ className="mt24 wmn3"
173
173
  onClick={() => setDisplay(false)}
174
174
  >
175
175
  Continue
176
- </button>
176
+ </Button>
177
177
  </div>
178
178
  </RegularModal>
179
179
  </>
@@ -202,21 +202,21 @@ export const BottomModalStory = ({
202
202
  Desktop only, you should check Regular modal instead. Want to use either
203
203
  Regular Modal or Bottom Modal based on the screen width? You can use
204
204
  Bottom or Regular modal.
205
- <button
206
- className="d-flex p-btn--primary wmn2 mt24"
205
+ <Button
206
+ className="wmn2 mt24"
207
207
  onClick={() => setDisplay(true)}
208
208
  >
209
209
  Click to open modal
210
- </button>
210
+ </Button>
211
211
  <BottomModal title={title} isOpen={display} onClose={handleOnClose}>
212
212
  <div style={{ padding: '0 24px 24px 24px' }}>
213
213
  <div>{children}</div>
214
- <button
215
- className="p-btn--primary mt24 wmn3"
214
+ <Button
215
+ className="mt24 wmn3"
216
216
  onClick={() => setDisplay(false)}
217
217
  >
218
218
  Continue
219
- </button>
219
+ </Button>
220
220
  </div>
221
221
  </BottomModal>
222
222
  </>
@@ -242,22 +242,22 @@ export const FullScreenModalStory = ({
242
242
  Full screen modals are primary meant to be used as blocker screens. The
243
243
  modal will cover the entire screen and the user will be able to dismiss
244
244
  them using the top left "X" icon.
245
- <button
246
- className="d-flex p-btn--primary wmn2 mt24"
245
+ <Button
246
+ className="wmn2 mt24"
247
247
  onClick={() => setDisplay(true)}
248
248
  >
249
249
  Click to open modal
250
- </button>
250
+ </Button>
251
251
  <FullScreenModal title={title} isOpen={display} onClose={handleOnClose}>
252
252
  <div style={{ padding: '0 24px 24px 24px' }}>
253
253
  <div>{children}</div>
254
254
 
255
- <button
256
- className="p-btn--primary mt24 wmn3"
255
+ <Button
256
+ className="mt24 wmn3"
257
257
  onClick={() => setDisplay(false)}
258
258
  >
259
259
  Continue
260
- </button>
260
+ </Button>
261
261
  </div>
262
262
  </FullScreenModal>
263
263
  </>
@@ -286,12 +286,12 @@ export const NonDismissibleModal = ({
286
286
  the modal options.
287
287
  <strong>Warning:</strong> a modal with the dismissible prop can only be
288
288
  closed by changing the isOpen prop to false.
289
- <button
290
- className="d-flex p-btn--primary wmn2 mt24"
289
+ <Button
290
+ className="wmn2 mt24"
291
291
  onClick={() => setDisplay(true)}
292
292
  >
293
293
  Click to open modal
294
- </button>
294
+ </Button>
295
295
  <BottomOrRegularModal
296
296
  dismissible={false}
297
297
  title={title}
@@ -300,12 +300,12 @@ export const NonDismissibleModal = ({
300
300
  >
301
301
  <div style={{ padding: '0 24px 24px 24px' }}>
302
302
  <div>{children}</div>
303
- <button
304
- className="p-btn--primary mt24 wmn3"
303
+ <Button
304
+ className="mt24 wmn3"
305
305
  onClick={() => setDisplay(false)}
306
306
  >
307
307
  Continue
308
- </button>
308
+ </Button>
309
309
  </div>
310
310
  </BottomOrRegularModal>
311
311
  </>
@@ -326,12 +326,12 @@ export const ModalWithFooter = ({
326
326
 
327
327
  return (
328
328
  <>
329
- <button
330
- className="d-flex p-btn--primary wmn2"
329
+ <Button
330
+ className="wmn2"
331
331
  onClick={() => setDisplay(true)}
332
332
  >
333
333
  Click to open modal
334
- </button>
334
+ </Button>
335
335
 
336
336
  <BottomOrRegularModal
337
337
  title={title}
@@ -340,7 +340,7 @@ export const ModalWithFooter = ({
340
340
  footer={
341
341
  <div className="d-flex fd-row gap8">
342
342
  <Button
343
- variant="textColor"
343
+ variant="textBlack"
344
344
  className="w100"
345
345
  onClick={handleOnClose}
346
346
  >
@@ -374,12 +374,12 @@ export const ModalWithFooterAndScroll = ({
374
374
 
375
375
  return (
376
376
  <>
377
- <button
378
- className="d-flex p-btn--primary wmn2"
377
+ <Button
378
+ className="wmn2"
379
379
  onClick={() => setDisplay(true)}
380
380
  >
381
381
  Click to open modal
382
- </button>
382
+ </Button>
383
383
 
384
384
  <BottomOrRegularModal
385
385
  title={title}
@@ -388,7 +388,7 @@ export const ModalWithFooterAndScroll = ({
388
388
  footer={
389
389
  <div className="d-flex fd-row gap8">
390
390
  <Button
391
- variant="textColor"
391
+ variant="textBlack"
392
392
  className="w100"
393
393
  onClick={handleOnClose}
394
394
  >
@@ -2,7 +2,7 @@
2
2
  position: relative;
3
3
  display: inline-block;
4
4
 
5
- background-color: var(--ds-primary-100);
5
+ background-color: var(--ds-purple-100);
6
6
  border-radius: 8px;
7
7
 
8
8
  padding: 0 8px;
@@ -13,4 +13,9 @@
13
13
  height: 100%;
14
14
  padding: 0;
15
15
  min-width: 32px;
16
- }
16
+
17
+ &Hidden {
18
+ visibility: hidden;
19
+ pointer-events: none;
20
+ }
21
+ }
@@ -30,7 +30,11 @@ const TableControls = ({
30
30
  >
31
31
  <div className='py24'>
32
32
  <Button
33
- className={classNames('br8', styles.controlButton)}
33
+ className={classNames(
34
+ { [styles.controlButtonHidden]: activeSection <= 1 },
35
+ 'br8',
36
+ styles.controlButton
37
+ )}
34
38
  disabled={activeSection <= 1}
35
39
  hideLabel
36
40
  leftIcon={<ChevronLeftIcon />}
@@ -48,7 +52,11 @@ const TableControls = ({
48
52
 
49
53
  <div className='py24'>
50
54
  <Button
51
- className={classNames('br8', styles.controlButton)}
55
+ className={classNames(
56
+ { [styles.controlButtonHidden]: activeSection >= columnsLength - 1 },
57
+ 'br8',
58
+ styles.controlButton
59
+ )}
52
60
  disabled={activeSection >= columnsLength - 1}
53
61
  hideLabel
54
62
  leftIcon={<ChevronRightIcon />}
@@ -49,36 +49,35 @@
49
49
 
50
50
  &--primary {
51
51
  @extend .p-btn;
52
- background-color: $ds-purple-600;
52
+ background-color: $ds-neutral-200;
53
53
  color: white;
54
54
 
55
55
  &:hover {
56
- background-color: $ds-purple-700;
56
+ background-color: $ds-neutral-300;
57
57
 
58
58
  @include p-size-mobile {
59
- background-color: $ds-purple-600;
59
+ background-color: $ds-neutral-300;
60
60
  }
61
61
  }
62
62
 
63
63
  &[disabled] {
64
- background-color: $ds-purple-500;
64
+ background-color: $ds-neutral-200;
65
65
  opacity: 1;
66
66
  }
67
67
 
68
- &:focus {
68
+ &:focus-visible {
69
69
  outline: none;
70
- box-shadow: 0 0 0 1px white,
71
- 0 0 0 3px rgba($color: $ds-purple-600, $alpha: 0.5);
70
+ box-shadow: 0 0 0 2px $ds-neutral-400;
72
71
  }
73
72
  }
74
73
 
75
74
  &--secondary {
76
75
  @extend .p-btn;
77
76
  background-color: transparent;
78
- color: $ds-purple-600;
77
+ color: $ds-neutral-900;
79
78
 
80
79
  &:hover {
81
- background-color: $ds-purple-300;
80
+ background-color: $ds-neutral-200;
82
81
 
83
82
  @include p-size-mobile {
84
83
  background-color: transparent;
@@ -86,36 +85,69 @@
86
85
  }
87
86
 
88
87
  &[disabled] {
89
- color: $ds-purple-700;
88
+ color: $ds-neutral-900;
90
89
 
91
90
  &:hover {
92
91
  background-color: transparent;
93
92
  }
94
93
  }
95
94
 
96
- &:focus {
95
+ &:focus-visible {
97
96
  outline: none;
98
- box-shadow: 0 0 0 1px white,
99
- 0 0 0 3px rgba($color: $ds-purple-600, $alpha: 0.5);
97
+ box-shadow: 0 0 0 2px $ds-neutral-900;
100
98
  }
101
99
 
102
100
  &-grey {
103
101
  @extend .p-btn--secondary;
104
- background-color: $ds-purple-100;
102
+ background-color: $ds-neutral-200;
103
+
104
+ &:hover {
105
+ background-color: $ds-neutral-300;
106
+ }
107
+
108
+ &:focus {
109
+ background-color: $ds-neutral-400;
110
+ }
111
+
112
+ &:focus-visible {
113
+ background-color: $ds-purple-100;
114
+ }
115
+ background-color: $ds-neutral-200;
116
+
117
+ &[disabled]:hover {
118
+ background-color: $ds-neutral-200;
119
+ }
120
+
105
121
  }
106
122
 
107
123
  &-white {
108
124
  @extend .p-btn--secondary;
109
125
  background-color: $ds-white;
126
+
127
+ &:hover {
128
+ background-color: $ds-neutral-200;
129
+ }
130
+
131
+ &:focus-visible {
132
+ box-shadow: 0 0 0 2px $ds-neutral-500;
133
+ }
110
134
  }
111
135
 
112
136
  &-inverted {
113
137
  @extend .p-btn--secondary;
114
138
  color: $ds-white;
115
139
 
116
- &:hover,
140
+ &:hover {
141
+ background-color: $ds-neutral-700;
142
+ }
143
+
117
144
  &:focus {
118
- background-color: $ds-purple-700;
145
+ background-color: $ds-neutral-600;
146
+ }
147
+
148
+ &:focus-visible {
149
+ background-color: transparent;
150
+ box-shadow: 0 0 0 2px $ds-white;
119
151
  }
120
152
  }
121
153
 
@@ -129,17 +161,16 @@
129
161
  }
130
162
 
131
163
  &[disabled] {
132
- background-color: $ds-neutral-900;
133
- color: white;
164
+ color: $ds-white;
165
+ background-color: rgba($ds-neutral-900, 50%);
134
166
 
135
167
  &:hover {
136
- background-color: $ds-neutral-900;
168
+ background-color: rgba($ds-neutral-900, 50%);
137
169
  }
138
170
  }
139
171
 
140
- &:focus {
141
- box-shadow: 0 0 0 1px white,
142
- 0 0 0 3px rgba($color: $ds-purple-900, $alpha: 0.5);
172
+ &:focus-visible {
173
+ box-shadow: 0 0 0 2px $ds-neutral-500;
143
174
  }
144
175
  }
145
176
  }
@@ -158,39 +189,14 @@
158
189
  }
159
190
 
160
191
  &[disabled] {
161
- background-color: $ds-red-300;
162
- opacity: 1;
163
- }
164
-
165
- &:focus {
166
- outline: none;
167
- box-shadow: 0 0 0 1px white,
168
- 0 0 0 3px rgba($color: $ds-purple-600, $alpha: 0.5);
169
- }
170
- }
171
-
172
- &--success {
173
- @extend .p-btn;
174
- background-color: $ds-green-500;
175
- color: white;
176
-
177
- &:hover {
178
- background-color: $ds-green-700;
179
-
180
- @include p-size-mobile {
181
- background-color: $ds-green-500;
182
- }
183
- }
184
-
185
- &[disabled] {
186
- background-color: $ds-green-300;
192
+ background-color: $ds-red-500;
193
+ color: $ds-red-300;
187
194
  opacity: 1;
188
195
  }
189
196
 
190
197
  &:focus {
191
198
  outline: none;
192
- box-shadow: 0 0 0 1px white,
193
- 0 0 0 3px rgba($color: $ds-purple-600, $alpha: 0.5);
199
+ box-shadow: 0 0 0 2px $ds-red-700;
194
200
  }
195
201
  }
196
202
 
@@ -228,8 +234,8 @@
228
234
  background-color: transparent;
229
235
 
230
236
  &:hover {
231
- background-color: $ds-purple-700;
232
- border-color: $ds-purple-700;
237
+ background-color: transparent;
238
+ border-color: $ds-white;
233
239
  }
234
240
 
235
241
  &[disabled] {
@@ -239,37 +245,66 @@
239
245
 
240
246
  &:focus {
241
247
  outline: none;
242
- box-shadow: 0 0 0 1px white,
243
- 0 0 0 3px rgba($color: $ds-purple-600, $alpha: 0.5);
248
+ box-shadow: 0 0 0 1px $ds-white;
244
249
  }
245
250
  }
246
251
 
247
252
  &-grey {
248
253
  @extend .p-btn;
249
254
 
250
- color: $ds-neutral-600;
255
+ color: $ds-neutral-900;
251
256
  background-color: transparent;
252
257
 
253
258
  border: 1px solid $ds-neutral-400;
254
259
 
255
260
  &:hover {
256
- color: $ds-neutral-700;
257
- border-color: $ds-neutral-600;
261
+ border-color: $ds-neutral-900;
258
262
  }
259
263
 
260
264
  &[disabled] {
261
- color: $ds-neutral-600;
262
265
  border-color: $ds-neutral-400;
263
- opacity: 0.5;
266
+ opacity: 0.7;
264
267
  }
265
268
 
266
269
  &:focus {
267
- color: $ds-neutral-700;
268
- border-color: $ds-neutral-700;
270
+ border-color: $ds-neutral-900;
271
+ box-shadow: 0 0 0 1px $ds-neutral-900;
272
+ color: $ds-neutral-900;
273
+ outline: 0;
269
274
  }
270
275
  }
271
276
  }
272
277
 
278
+ &--text-black {
279
+ @extend .p-btn;
280
+
281
+ color: $ds-purple-900;
282
+ background-color: transparent;
283
+ border: 1px solid transparent;
284
+
285
+ &:hover {
286
+ border-color: $ds-neutral-400;
287
+ }
288
+
289
+ &:focus {
290
+ border-color: $ds-neutral-500;
291
+ }
292
+
293
+ &:focus-visible {
294
+ background-color: transparent;
295
+ border: 1px solid $ds-neutral-900;
296
+ box-shadow: 0 0 0 1px $ds-neutral-900;
297
+ outline: 0;
298
+ }
299
+
300
+ &[disabled] {
301
+ opacity: 0.5;
302
+ background-color: transparent;
303
+ border: none;
304
+ }
305
+
306
+ }
307
+
273
308
  &--loading {
274
309
  color: transparent;
275
310
  cursor: default;
@@ -296,12 +331,19 @@
296
331
  animation: spinner-rotate 0.9s infinite;
297
332
  }
298
333
 
334
+
335
+ &:focus-visible {
336
+ box-shadow: none;
337
+ border-color: transparent;
338
+ }
339
+
299
340
  &.p-btn--secondary:not(.p-btn--secondary-black),
300
341
  &.p-btn--secondary-grey,
342
+ &.p-btn--text-black,
301
343
  &.p-btn--secondary-white {
302
344
  &::before {
303
- border-color: rgba($color: $ds-purple-600, $alpha: 0.5);
304
- border-left-color: $ds-purple-600;
345
+ border-color: rgba($color: $ds-neutral-900, $alpha: 0.5);
346
+ border-left-color: $ds-neutral-900;
305
347
  }
306
348
  }
307
349
  }