@ship-ui/core 0.13.2

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 (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/assets/fonts/InterTight-VariableFont_wght.woff2 +0 -0
  4. package/bin/ship-fg-node +40 -0
  5. package/bin/ship-fg.ts +40 -0
  6. package/bin/src/ship-fg-node.js +344 -0
  7. package/bin/src/ship-fg.ts +368 -0
  8. package/bin/src/utilities.js +53 -0
  9. package/bin/src/utilities.ts +98 -0
  10. package/bin/tsconfig.app.json +15 -0
  11. package/fesm2022/ship-ui-core.mjs +5373 -0
  12. package/fesm2022/ship-ui-core.mjs.map +1 -0
  13. package/index.d.ts +758 -0
  14. package/package.json +52 -0
  15. package/styles/components/ship-alert-container.component.scss +49 -0
  16. package/styles/components/ship-alert.component.scss +273 -0
  17. package/styles/components/ship-button-group.component.scss +63 -0
  18. package/styles/components/ship-button.component.scss +330 -0
  19. package/styles/components/ship-card.component.scss +54 -0
  20. package/styles/components/ship-checkbox.component.scss +245 -0
  21. package/styles/components/ship-chip.component.scss +290 -0
  22. package/styles/components/ship-color-picker.component.scss +78 -0
  23. package/styles/components/ship-datepicker.component.scss +274 -0
  24. package/styles/components/ship-dialog.component.scss +119 -0
  25. package/styles/components/ship-divider.component.scss +27 -0
  26. package/styles/components/ship-file-upload.component.scss +47 -0
  27. package/styles/components/ship-form-field.component.scss +334 -0
  28. package/styles/components/ship-icon.component.scss +54 -0
  29. package/styles/components/ship-list.component.scss +148 -0
  30. package/styles/components/ship-menu.component.scss +217 -0
  31. package/styles/components/ship-popover.component.scss +66 -0
  32. package/styles/components/ship-progress-bar.component.scss +173 -0
  33. package/styles/components/ship-radio.component.scss +182 -0
  34. package/styles/components/ship-range-slider.component.scss +412 -0
  35. package/styles/components/ship-select.component.scss +139 -0
  36. package/styles/components/ship-sidenav.component.scss +192 -0
  37. package/styles/components/ship-sortable.component.scss +54 -0
  38. package/styles/components/ship-spinner.component.scss +53 -0
  39. package/styles/components/ship-stepper.component.scss +138 -0
  40. package/styles/components/ship-table.component.scss +402 -0
  41. package/styles/components/ship-tabs.component.scss +86 -0
  42. package/styles/components/ship-toggle-card.component.scss +71 -0
  43. package/styles/components/ship-toggle.component.scss +238 -0
  44. package/styles/components/ship-tooltip.component.scss +175 -0
  45. package/styles/components/ship-virtual-scroll.component.scss +12 -0
  46. package/styles/components/sparkle-checkbox.component.scss +245 -0
  47. package/styles/components/sparkle-select.component.scss +139 -0
  48. package/styles/core/apexcharts/apexcharts.scss +58 -0
  49. package/styles/core/core/layout.scss +74 -0
  50. package/styles/core/core/loader.scss +63 -0
  51. package/styles/core/core/palette-variables.scss +352 -0
  52. package/styles/core/core/typography.scss +103 -0
  53. package/styles/core/core/variables.scss +188 -0
  54. package/styles/core/core.scss +4 -0
  55. package/styles/core/fonts/_inter-tight.scss +11 -0
  56. package/styles/core/helpers/fn/color-mix.scss +7 -0
  57. package/styles/core/helpers/fn/dp.scss +14 -0
  58. package/styles/core/helpers/fn/p2r.scss +23 -0
  59. package/styles/core/helpers/mixins/border-gradient.scss +61 -0
  60. package/styles/core/helpers/mixins/breakpoint.scss +217 -0
  61. package/styles/core/helpers/mixins/ellipsis.scss +7 -0
  62. package/styles/core/helpers/mixins/overflow-scrolling.scss +18 -0
  63. package/styles/core/helpers/mixins/wrapper.scss +16 -0
  64. package/styles/core/polyfill/light-dark.scss +3 -0
  65. package/styles/helpers.scss +13 -0
  66. package/styles/index.scss +146 -0
@@ -0,0 +1,402 @@
1
+ @use '../helpers.scss' as *;
2
+
3
+ $shipTable: true !default;
4
+
5
+ @mixin caret($color) {
6
+ border-left: p2r(3) solid $color;
7
+ border-bottom: p2r(3) solid $color;
8
+ width: p2r(8);
9
+ height: p2r(8);
10
+ transform: rotate(45deg);
11
+ }
12
+
13
+ @if $shipTable == true {
14
+ sh-table {
15
+ --table-bc: var(--base-4);
16
+ --table-th-bg: var(--base-1);
17
+ --table-tr-bg: var(--base-1);
18
+ --table-td-bg: var(--base-1);
19
+ --table-th-c: var(--base-8);
20
+ --table-th-f: var(--paragraph-30);
21
+ --table-td-c: var(--base-8);
22
+ --table-td-f: var(--paragraph-30);
23
+ --table-th-p: #{p2r(0 20)};
24
+ --table-td-p: #{p2r(0 20)};
25
+ --table-th-mh: #{p2r(48)};
26
+ --table-td-mh: #{p2r(78)};
27
+ --table-th-g: #{p2r(4)};
28
+ --table-td-g: #{p2r(8)};
29
+ --table-ws: nowrap;
30
+ --table-th-bw: 0;
31
+ --table-td-bw: #{p2r(1 0 0)};
32
+ --table-columns: 1fr 1fr 1fr max-content;
33
+ --table-sticky-bw: #{p2r(1)};
34
+
35
+ &.type-a {
36
+ tbody,
37
+ thead {
38
+ > th,
39
+ > td {
40
+ padding-right: 0;
41
+
42
+ &:first-child {
43
+ padding: 0;
44
+ }
45
+ }
46
+ }
47
+
48
+ &.scrolled-x.can-scroll-x {
49
+ [shStickyColumns=''],
50
+ th.sticky,
51
+ td.sticky {
52
+ border-right-width: p2r(1);
53
+ }
54
+ }
55
+
56
+ &:not(.scrolled-x-end).can-scroll-x {
57
+ [shStickyColumns='end'],
58
+ th.sticky-end,
59
+ td.sticky-end {
60
+ border-left-width: p2r(1);
61
+ }
62
+ }
63
+ }
64
+
65
+ &.type-b {
66
+ --table-th-p: #{p2r(0 12)};
67
+ --table-td-p: #{p2r(0 12)};
68
+ --table-th-mh: #{p2r(36)};
69
+ --table-td-mh: #{p2r(56)};
70
+ --table-th-bw: #{p2r(1 0 1 1)};
71
+ --table-td-bw: #{p2r(0 0 1 1)};
72
+ --table-th-bg: var(--base-2);
73
+ --table-sticky-bw: #{p2r(2)};
74
+
75
+ th {
76
+ &:first-child {
77
+ border-left-width: 0;
78
+ padding: var(--table-th-p);
79
+ }
80
+ }
81
+
82
+ td {
83
+ &:first-child {
84
+ border-left-width: 0;
85
+ padding: var(--table-td-p);
86
+ }
87
+ }
88
+
89
+ [shStickyColumns='end'] {
90
+ border-left-width: p2r(2);
91
+ }
92
+
93
+ &.scrolled-x {
94
+ [shStickyColumns=''] {
95
+ border-right-width: p2r(2);
96
+ }
97
+ }
98
+
99
+ &.scrolled-x-end {
100
+ [shStickyColumns='end'] {
101
+ border-left-width: p2r(1);
102
+ }
103
+ }
104
+
105
+ td,
106
+ th {
107
+ &.sticky {
108
+ border-left-width: 0;
109
+ border-right-width: p2r(1);
110
+ }
111
+ &.sticky + * {
112
+ border-left-width: 0;
113
+ }
114
+ }
115
+
116
+ div[table-header] tr:first-child th {
117
+ border-bottom: 0;
118
+ }
119
+ }
120
+
121
+ width: 100%;
122
+ display: grid;
123
+ overflow: auto;
124
+ grid-template-columns: var(--table-columns);
125
+ position: relative;
126
+
127
+ &.resizing {
128
+ user-select: none;
129
+ }
130
+
131
+ &:has([shTableResize]) {
132
+ td {
133
+ overflow: auto;
134
+ }
135
+ }
136
+
137
+ &.no-resize {
138
+ .sh-resizer {
139
+ display: none;
140
+ }
141
+
142
+ td {
143
+ overflow: initial;
144
+ }
145
+ }
146
+
147
+ tbody {
148
+ position: relative;
149
+
150
+ // &:has(div[table-header].sticky),
151
+ &:has(tr.sticky) {
152
+ position: sticky;
153
+ top: 0;
154
+ z-index: 2;
155
+ }
156
+ }
157
+
158
+ sh-progress-bar {
159
+ grid-column: 1 / -1;
160
+ position: absolute;
161
+ top: 100%;
162
+ transform: translateY(-50%);
163
+ z-index: 200;
164
+ }
165
+
166
+ tbody,
167
+ // thead,
168
+ // div[table-header].sticky,
169
+ tr {
170
+ display: grid;
171
+ grid-column: 1 / -1;
172
+ grid-template-columns: subgrid;
173
+ }
174
+
175
+ tr {
176
+ background: var(--table-tr-bg);
177
+ position: relative;
178
+ z-index: 0;
179
+
180
+ &.sticky {
181
+ position: sticky;
182
+ top: 0;
183
+ z-index: 1;
184
+ }
185
+
186
+ &.sticky-end {
187
+ position: sticky;
188
+ bottom: 0;
189
+ z-index: 3;
190
+ }
191
+
192
+ &:has(th.sticky-end) {
193
+ th:nth-last-child(2) {
194
+ padding: var(--table-th-p);
195
+ }
196
+ }
197
+
198
+ &:has(td.sticky-end) {
199
+ td:nth-last-child(2) {
200
+ padding: var(--table-td-p);
201
+ }
202
+ }
203
+ }
204
+
205
+ th {
206
+ display: flex;
207
+ align-items: center;
208
+ padding: var(--table-th-p);
209
+ min-height: var(--table-th-mh);
210
+ font: var(--table-th-f);
211
+ line-height: 1em;
212
+ white-space: var(--table-ws);
213
+ color: var(--table-th-c);
214
+ border: 0;
215
+ border-color: var(--table-bc);
216
+ border-style: solid;
217
+ border-width: var(--table-th-bw);
218
+ background: var(--table-th-bg);
219
+ gap: var(--table-th-g);
220
+ z-index: 100;
221
+
222
+ &:has(.sh-resizer) {
223
+ position: relative;
224
+ }
225
+
226
+ &.sortable {
227
+ --caret-color: var(--base-10);
228
+ --caret-size: #{p2r(6)};
229
+
230
+ cursor: pointer;
231
+ user-select: none;
232
+
233
+ &:not(:has(sh-icon)) {
234
+ &:after {
235
+ content: '';
236
+ border: var(--caret-size) solid transparent;
237
+ width: 0;
238
+ height: 0;
239
+ opacity: 0;
240
+ transition: opacity 125ms ease-in-out;
241
+ }
242
+
243
+ &.sort-desc::after {
244
+ opacity: 1;
245
+ transform: translateY(-4px);
246
+ border-bottom-color: var(--caret-color);
247
+ }
248
+
249
+ &.sort-asc::after {
250
+ opacity: 1;
251
+ transform: translateY(4px);
252
+ border-top-color: var(--caret-color);
253
+ }
254
+ }
255
+ }
256
+
257
+ .sh-resizer {
258
+ width: 10px;
259
+ height: 100%;
260
+ position: absolute;
261
+ top: 0;
262
+ right: 0;
263
+ cursor: col-resize;
264
+
265
+ &:before,
266
+ &:after {
267
+ content: '';
268
+ position: absolute;
269
+ top: 50%;
270
+ transform: translateY(-50%);
271
+ height: p2r(12);
272
+ right: p2r(3);
273
+ width: p2r(1);
274
+ background-color: var(--base-4);
275
+ }
276
+
277
+ &:hover {
278
+ &:before,
279
+ &:after {
280
+ background-color: var(--primary-8);
281
+ }
282
+ }
283
+
284
+ &:before {
285
+ left: p2r(3);
286
+ }
287
+ }
288
+ }
289
+
290
+ td {
291
+ display: flex;
292
+ align-items: center;
293
+ padding: var(--table-td-p);
294
+ min-height: var(--table-td-mh);
295
+ gap: var(--table-td-g);
296
+ color: var(--table-td-c);
297
+ font: var(--table-td-f);
298
+ white-space: var(--table-ws);
299
+ border-color: var(--table-bc);
300
+ border-style: solid;
301
+ border-width: var(--table-td-bw);
302
+ background: var(--table-td-bg);
303
+
304
+ + td.sticky-end:last-child {
305
+ padding: var(--table-td-p);
306
+ }
307
+ }
308
+
309
+ th,
310
+ td {
311
+ &.sticky,
312
+ &.sticky-end {
313
+ position: sticky;
314
+ overflow: hidden;
315
+ right: auto;
316
+ left: 0;
317
+ z-index: 1;
318
+ padding: var(--table-td-p);
319
+
320
+ &:first-child {
321
+ padding: var(--table-th-p);
322
+ }
323
+ }
324
+
325
+ &.sticky-end {
326
+ right: 0;
327
+ left: auto;
328
+ }
329
+ }
330
+
331
+ th {
332
+ &.sticky,
333
+ &.sticky-end {
334
+ background: var(--table-th-bg);
335
+ padding: var(--table-th-p);
336
+ z-index: 101;
337
+
338
+ &:first-child {
339
+ padding: var(--table-th-p);
340
+ }
341
+ }
342
+ }
343
+
344
+ [shStickyRows] {
345
+ display: grid;
346
+ grid-column: 1 / -1;
347
+ grid-template-columns: subgrid;
348
+ grid-template-rows: subgrid;
349
+ position: sticky;
350
+ top: 0;
351
+ z-index: 1; // Needs to be the same as regular sticky rows
352
+ border: 0;
353
+ border-color: var(--table-bc);
354
+ border-style: solid;
355
+ }
356
+
357
+ [shStickyColumns] {
358
+ display: grid;
359
+ grid-template-columns: subgrid;
360
+ position: sticky;
361
+ left: 0;
362
+ z-index: 1000;
363
+ border: 0;
364
+ border-color: var(--table-bc);
365
+ border-style: solid;
366
+ }
367
+
368
+ [shStickyColumns='end'] {
369
+ left: auto;
370
+ right: 0;
371
+ }
372
+
373
+ thead {
374
+ > [shStickyColumns] {
375
+ border-width: var(--table-th-bw);
376
+ }
377
+ }
378
+
379
+ tbody {
380
+ > [shStickyColumns] {
381
+ border-width: var(--table-td-bw);
382
+ }
383
+ }
384
+
385
+ .span-all {
386
+ grid-column: 1 / -1;
387
+ white-space: initial;
388
+ align-items: flex-start;
389
+ padding: 0;
390
+ border-left-width: 0;
391
+ }
392
+
393
+ .no-rows {
394
+ display: none;
395
+ grid-column: 1 / -1;
396
+ }
397
+
398
+ tbody:empty + .no-rows {
399
+ display: block;
400
+ }
401
+ }
402
+ }
@@ -0,0 +1,86 @@
1
+ @use '../helpers.scss' as *;
2
+
3
+ $shipTabs: true !default;
4
+
5
+ @if $shipTabs == true {
6
+ sh-tabs {
7
+ --tabs-bc: var(--base-4);
8
+ --tabs-bg: var(--base-1);
9
+ --tabs-c: var(--base-12);
10
+ --tabs-c-hover: var(--base-8);
11
+ --tabs-c-active: var(--base-12);
12
+ --tabs-f: var(--paragraph-30);
13
+ --tabs-sel-bg: var(--base-12);
14
+
15
+ display: flex;
16
+ gap: p2r(16);
17
+ border-bottom: 1px solid var(--base-4);
18
+
19
+ [tab] {
20
+ display: flex;
21
+ align-items: center;
22
+ gap: p2r(8);
23
+ height: p2r(48);
24
+ font: var(--tabs-f);
25
+ background: var(--tabs-bg);
26
+ border-radius: 0;
27
+ appearance: none;
28
+ border: 0;
29
+ color: var(--tabs-c);
30
+ cursor: pointer;
31
+ position: relative;
32
+
33
+ &:focus {
34
+ outline: none;
35
+ }
36
+
37
+ &:hover {
38
+ color: var(--tabs-c-hover);
39
+ }
40
+
41
+ &.active {
42
+ color: var(--tabs-c-active);
43
+
44
+ &::after {
45
+ display: block;
46
+ }
47
+ }
48
+
49
+ &:after {
50
+ content: '';
51
+ display: none;
52
+ width: 100%;
53
+ height: 2px;
54
+ background: var(--tabs-sel-bg);
55
+ position: absolute;
56
+ left: 0;
57
+ bottom: 0;
58
+ }
59
+ }
60
+
61
+ &.primary {
62
+ --tabs-sel-bg: var(--primary-8);
63
+ --tabs-c-active: var(--primary-8);
64
+ }
65
+
66
+ &.accent {
67
+ --tabs-sel-bg: var(--accent-8);
68
+ --tabs-c-active: var(--accent-8);
69
+ }
70
+
71
+ &.warn {
72
+ --tabs-sel-bg: var(--warn-8);
73
+ --tabs-c-active: var(--warn-8);
74
+ }
75
+
76
+ &.error {
77
+ --tabs-sel-bg: var(--error-8);
78
+ --tabs-c-active: var(--error-8);
79
+ }
80
+
81
+ &.success {
82
+ --tabs-sel-bg: var(--success-8);
83
+ --tabs-c-active: var(--success-8);
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,71 @@
1
+ @use '../helpers.scss' as *;
2
+
3
+ $shipToggleCard: true !default;
4
+
5
+ @if $shipToggleCard == true {
6
+ sh-toggle-card {
7
+ display: flex;
8
+ flex-direction: column;
9
+ border-radius: var(--shape-3);
10
+ background-color: var(--base-2);
11
+
12
+ &.active {
13
+ .collapsable {
14
+ grid-template-rows: 1fr;
15
+ }
16
+
17
+ .content {
18
+ // grid-template-rows: 1fr;
19
+ // transition: max-height 1s linear;
20
+ padding: p2r(0 16 16);
21
+
22
+ &:empty {
23
+ padding: p2r(0 16);
24
+ }
25
+ }
26
+
27
+ sh-icon.toggle-icon {
28
+ transform: rotate(180deg);
29
+ }
30
+ }
31
+
32
+ h3 {
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: space-between;
36
+ font: var(--paragraph-10);
37
+ padding: p2r(16);
38
+ cursor: pointer;
39
+ user-select: none;
40
+ }
41
+
42
+ sh-icon.toggle-icon {
43
+ cursor: pointer;
44
+ transform: rotate(0);
45
+ transform-origin: center;
46
+ transition: transform 200ms ease;
47
+ }
48
+
49
+ .collapsable {
50
+ display: grid;
51
+ grid-template-rows: 0fr;
52
+ transition: grid-template-rows 0.5s linear;
53
+ overflow: hidden;
54
+ }
55
+
56
+ .content {
57
+ display: flex;
58
+ flex-direction: column;
59
+ gap: p2r(16);
60
+
61
+ padding: p2r(0 16);
62
+ min-height: 0;
63
+ overflow: hidden;
64
+ // overflow: hidden;
65
+ // max-height: 0;
66
+ // transition:
67
+ // max-height 250ms linear,
68
+ // padding 250ms linear;
69
+ }
70
+ }
71
+ }