@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,217 @@
1
+ @use '../helpers.scss' as *;
2
+
3
+ $shipMenu: true !default;
4
+
5
+ @if $shipMenu == true {
6
+ sh-menu {
7
+ --menu-mh: #{p2r(320)};
8
+
9
+ display: inline-flex;
10
+ position: relative;
11
+
12
+ &.disabled {
13
+ opacity: 0.5;
14
+ pointer-events: none;
15
+ }
16
+
17
+ &.stretch {
18
+ width: 100%;
19
+
20
+ [trigger] > * {
21
+ width: 100%;
22
+ }
23
+ }
24
+
25
+ &.has-search {
26
+ sh-popover .options {
27
+ [title] {
28
+ position: sticky;
29
+ border-bottom: 1px solid var(--base-4);
30
+ }
31
+ }
32
+
33
+ .form-field-wrap {
34
+ margin: p2r(8 8 0);
35
+ }
36
+
37
+ .options {
38
+ margin: p2r(4 0 0);
39
+ }
40
+ }
41
+
42
+ &.multi-layer {
43
+ [trigger] {
44
+ &:has(sh-icon.open-indicator) {
45
+ &.is-open .open-indicator {
46
+ transform: translateY(-50%) rotate(-90deg);
47
+ }
48
+ }
49
+
50
+ &:has(sh-icon.open-indicator) {
51
+ display: flex;
52
+
53
+ .open-indicator {
54
+ right: p2r(16);
55
+ }
56
+ }
57
+ button:first-child {
58
+ margin-top: 0;
59
+ }
60
+ }
61
+ }
62
+
63
+ [trigger]:has(sh-icon.open-indicator) {
64
+ position: relative;
65
+
66
+ > :first-child {
67
+ padding-right: p2r(32);
68
+ }
69
+
70
+ .open-indicator {
71
+ position: absolute;
72
+ right: p2r(8);
73
+ top: 50%;
74
+ transform: translateY(-50%);
75
+ color: var(--base-8);
76
+ font-size: p2r(16);
77
+ font-weight: inherit;
78
+ pointer-events: none;
79
+ transition: transform 75ms ease-in-out;
80
+ }
81
+
82
+ &.is-open .open-indicator {
83
+ transform: translateY(-50%) rotate(-180deg);
84
+ }
85
+ }
86
+
87
+ sh-popover {
88
+ flex: 1 0;
89
+
90
+ .popover {
91
+ padding: 0;
92
+ }
93
+
94
+ .overlay ~ .form-field-wrap {
95
+ sh-form-field {
96
+ z-index: 10;
97
+ background-color: var(--base-1);
98
+
99
+ &.hidden {
100
+ opacity: 0;
101
+ height: 0;
102
+ width: 0;
103
+ min-width: 0;
104
+ min-height: 0;
105
+ margin: 0;
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ sh-popover .options {
112
+ z-index: 2;
113
+ position: relative;
114
+ display: flex;
115
+ flex-direction: column;
116
+ gap: p2r(4);
117
+ padding: 0;
118
+ margin: 0;
119
+ max-height: var(--menu-mh);
120
+ overflow: auto;
121
+
122
+ button:first-child {
123
+ margin-top: p2r(8);
124
+ }
125
+
126
+ &.searching {
127
+ button[disabled] {
128
+ display: none;
129
+ }
130
+
131
+ button[value='0'] {
132
+ display: none;
133
+ }
134
+
135
+ *:not(button) {
136
+ display: none;
137
+ }
138
+ }
139
+
140
+ &:after {
141
+ content: '';
142
+ display: block;
143
+ width: 100%;
144
+ min-height: p2r(4);
145
+ order: 9999999;
146
+ }
147
+
148
+ [title] {
149
+ font: var(--paragraph-30);
150
+ color: var(--base-8);
151
+ padding: p2r(8 12);
152
+ margin: 0;
153
+ user-select: none;
154
+ position: relative;
155
+ top: 0;
156
+ z-index: 10;
157
+ background-color: var(--base-1);
158
+ }
159
+
160
+ button {
161
+ display: flex;
162
+ justify-content: flex-start;
163
+ align-items: center;
164
+ text-align: left;
165
+ min-height: p2r(32);
166
+ margin: p2r(0 8);
167
+ padding: p2r(0 8);
168
+ gap: p2r(8);
169
+ width: calc(100% - #{p2r(16)});
170
+ border-radius: var(--shape-2);
171
+ appearance: none;
172
+ background-color: transparent;
173
+ border: 0;
174
+ cursor: pointer;
175
+ color: var(--base-12);
176
+
177
+ &[disabled] {
178
+ opacity: 0.3;
179
+ cursor: initial;
180
+
181
+ &:hover {
182
+ background-color: transparent;
183
+ }
184
+ }
185
+
186
+ [suffix] {
187
+ order: 999;
188
+ color: var(--base-8);
189
+ font: var(--paragraph-30);
190
+ justify-self: flex-end;
191
+ display: inline-flex;
192
+ flex: 1 0;
193
+ justify-content: flex-end;
194
+ }
195
+
196
+ sh-icon {
197
+ font-size: p2r(16);
198
+ }
199
+
200
+ &.active,
201
+ &:hover {
202
+ background-color: var(--base-2);
203
+ color: var(--base-12);
204
+ }
205
+
206
+ &.focused {
207
+ background-color: var(--primary-2);
208
+ color: var(--base-12);
209
+
210
+ &:hover {
211
+ background-color: var(--primary-3);
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+ }
@@ -0,0 +1,66 @@
1
+ @use '../helpers.scss' as *;
2
+
3
+ $shipPopover: true !default;
4
+
5
+ @if $shipPopover == true {
6
+ sh-popover {
7
+ --po-d: inherit;
8
+
9
+ display: var(--po-d);
10
+
11
+ &.multi-layer {
12
+ .popover {
13
+ top: anchor(top);
14
+ left: calc(anchor(right) - #{p2r(10)});
15
+ }
16
+ }
17
+
18
+ .trigger {
19
+ cursor: pointer;
20
+ display: var(--po-d);
21
+ position: relative;
22
+
23
+ .trigger-wrapper {
24
+ display: var(--po-d);
25
+
26
+ &:empty + * {
27
+ display: inherit;
28
+ }
29
+ }
30
+ }
31
+
32
+ .overlay {
33
+ position: fixed;
34
+ inset: 0;
35
+ opacity: 0;
36
+ z-index: -1;
37
+ }
38
+
39
+ .popover {
40
+ position: absolute;
41
+ margin: 0;
42
+ min-width: p2r(180);
43
+ z-index: 0;
44
+ background-color: var(--base-1);
45
+ border: 1px solid var(--base-4);
46
+ border-radius: var(--shape-2);
47
+ font: var(--paragraph-30);
48
+ color: var(--base-8);
49
+
50
+ @supports (anchor-name: --anchor) {
51
+ inset: unset;
52
+ left: anchor(left);
53
+ top: calc(anchor(bottom) + #{p2r(4)});
54
+ position: fixed;
55
+ position-try-order:
56
+ flip-block,
57
+ flip-inline,
58
+ flip-block flip-inline;
59
+ position-try-fallbacks:
60
+ flip-block,
61
+ flip-inline,
62
+ flip-block flip-inline;
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,173 @@
1
+ @use '../helpers.scss' as *;
2
+
3
+ $shipProgressBar: true !default;
4
+
5
+ @if $shipProgressBar == true {
6
+ sh-progress-bar {
7
+ --pb-h: #{p2r(8)};
8
+ --pb-b: var(--base-4);
9
+ --pb-bg: var(--base-2);
10
+ --pb-br: var(--shape-2);
11
+ --pbt-bg: var(--base-6);
12
+ --pbt-br: inherit;
13
+
14
+ display: block;
15
+ width: 100%;
16
+ height: var(--pb-h);
17
+ position: relative;
18
+ overflow: hidden;
19
+
20
+ border-radius: var(--pb-br);
21
+ background: var(--pb-bg);
22
+
23
+ .progress-bar {
24
+ position: absolute;
25
+ top: 0;
26
+ left: 0;
27
+ bottom: 0;
28
+ height: 100%;
29
+ transform-origin: top left;
30
+
31
+ border-radius: var(--pbt-br);
32
+ background: var(--pbt-bg);
33
+ }
34
+
35
+ &.indeterminate {
36
+ .progress-bar {
37
+ right: 0;
38
+ animation: indeterminate-progress-bar-stripes 2s linear infinite;
39
+ }
40
+
41
+ &:after {
42
+ content: '';
43
+ position: absolute;
44
+ top: 0;
45
+ left: 0;
46
+ right: 0;
47
+ bottom: 0;
48
+ background-color: var(--base-2);
49
+ animation: indeterminate-progress-bar-stripes-background 2s linear infinite;
50
+ transform-origin: top left;
51
+ }
52
+ }
53
+
54
+ &.primary {
55
+ --pbt-bg: var(--primary-8);
56
+ }
57
+
58
+ &.accent {
59
+ --pbt-bg: var(--accent-8);
60
+ }
61
+
62
+ &.warn {
63
+ --pbt-bg: var(--warn-8);
64
+ }
65
+
66
+ &.error {
67
+ --pbt-bg: var(--error-8);
68
+ }
69
+
70
+ &.success {
71
+ --pbt-bg: var(--success-8);
72
+ }
73
+
74
+ &.outlined {
75
+ --pb-b: 1px solid var(--base-4);
76
+ --pb-bg: var(--base-1);
77
+
78
+ &:after {
79
+ background-color: inherit;
80
+ }
81
+ }
82
+
83
+ &.flat {
84
+ --pbt-bg: var(--base-8);
85
+
86
+ &:after {
87
+ background-color: inherit;
88
+ }
89
+
90
+ &.primary {
91
+ --pbt-bg: var(--primary-8);
92
+ }
93
+
94
+ &.accent {
95
+ --pbt-bg: var(--accent-8);
96
+ }
97
+
98
+ &.warn {
99
+ --pbt-bg: var(--warn-8);
100
+ }
101
+
102
+ &.error {
103
+ --pbt-bg: var(--error-8);
104
+ }
105
+
106
+ &.success {
107
+ --pbt-bg: var(--success-8);
108
+ }
109
+ }
110
+
111
+ &.raised {
112
+ --pbt-bg: var(--base-g3);
113
+
114
+ &.primary {
115
+ --pbt-bg: var(--primary-g3);
116
+ }
117
+
118
+ &.accent {
119
+ --pbt-bg: var(--accent-g3);
120
+ }
121
+
122
+ &.warn {
123
+ --pbt-bg: var(--warn-g3);
124
+ }
125
+
126
+ &.error {
127
+ --pbt-bg: var(--error-g3);
128
+ }
129
+
130
+ &.success {
131
+ --pbt-bg: var(--success-g3);
132
+ }
133
+ }
134
+ }
135
+
136
+ @keyframes indeterminate-progress-bar-stripes-background {
137
+ 0% {
138
+ animation-timing-function: cubic-bezier(0.15, 0, 0.515058, 0.409685);
139
+ transform: translateX(0);
140
+ }
141
+
142
+ 25% {
143
+ animation-timing-function: cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);
144
+ transform: translateX(37.651913%);
145
+ }
146
+
147
+ 48.35% {
148
+ animation-timing-function: cubic-bezier(0.4, 0.627035, 0.6, 0.902026);
149
+ transform: translateX(84.386165%);
150
+ }
151
+
152
+ 100% {
153
+ transform: translateX(160.277782%);
154
+ }
155
+ }
156
+
157
+ @keyframes indeterminate-progress-bar-stripes {
158
+ 0% {
159
+ transform: translateX(0);
160
+ }
161
+ 20% {
162
+ animation-timing-function: cubic-bezier(0.5, 0, 0.701732, 0.495819);
163
+ transform: translateX(0);
164
+ }
165
+ 59.15% {
166
+ animation-timing-function: cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);
167
+ transform: translateX(83.67142%);
168
+ }
169
+ 100% {
170
+ transform: translateX(200.611057%);
171
+ }
172
+ }
173
+ }
@@ -0,0 +1,182 @@
1
+ @use '../helpers.scss' as *;
2
+
3
+ $shipRadio: true !default;
4
+
5
+ @if $shipRadio == true {
6
+ sh-radio {
7
+ --radio-bw: #{p2r(1)};
8
+ --radio-bg: var(--base-2);
9
+ --radio-bc: var(--base-4);
10
+ --radio-c: var(--base-8);
11
+ --radiod-o: 0;
12
+ --radiod-c: var(--base-8);
13
+
14
+ display: flex;
15
+ align-items: center;
16
+ gap: p2r(8);
17
+ cursor: pointer;
18
+ user-select: none;
19
+ position: relative;
20
+
21
+ > input[type='radio'] {
22
+ appearance: none;
23
+ position: absolute;
24
+ inset: 0;
25
+ cursor: pointer;
26
+
27
+ &:focus {
28
+ outline: none;
29
+ }
30
+ }
31
+
32
+ &:has(input[disabled]),
33
+ &[disabled]:not([disabled='false']) {
34
+ opacity: 0.5;
35
+ pointer-events: none;
36
+ user-select: none;
37
+ cursor: initial;
38
+ }
39
+
40
+ &:has(input[type='radio']:checked),
41
+ &.active {
42
+ --radiod-o: 1;
43
+ }
44
+
45
+ .radio {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ width: p2r(20);
50
+ height: p2r(20);
51
+ cursor: pointer;
52
+ position: relative;
53
+ border-radius: 50%;
54
+ border: var(--radio-bw) solid var(--radio-bc);
55
+ background: var(--radio-bg);
56
+ font-size: p2r(12);
57
+ color: var(--radio-c);
58
+
59
+ &:after {
60
+ content: '';
61
+ position: absolute;
62
+ top: 50%;
63
+ left: 50%;
64
+ transform: translate(-50%, -50%);
65
+ border-radius: 50%;
66
+ width: p2r(6);
67
+ height: p2r(6);
68
+ background-color: var(--radiod-c);
69
+ opacity: var(--radiod-o);
70
+ transition: opacity 125ms linear;
71
+ }
72
+ }
73
+
74
+ &.primary {
75
+ --radio-c: var(--primary-8);
76
+ --radiod-c: var(--primary-8);
77
+ --radio-bg: var(--primary-3);
78
+ --radio-bc: var(--primary-4);
79
+ }
80
+
81
+ &.accent {
82
+ --radio-c: var(--accent-8);
83
+ --radiod-c: var(--accent-8);
84
+ --radio-bg: var(--accent-3);
85
+ --radio-bc: var(--accent-4);
86
+ }
87
+
88
+ &.warn {
89
+ --radio-c: var(--warn-8);
90
+ --radiod-c: var(--warn-8);
91
+ --radio-bg: var(--warn-3);
92
+ --radio-bc: var(--warn-4);
93
+ }
94
+
95
+ &.error {
96
+ --radio-c: var(--error-8);
97
+ --radiod-c: var(--error-8);
98
+ --radio-bg: var(--error-3);
99
+ --radio-bc: var(--error-4);
100
+ }
101
+
102
+ &.success {
103
+ --radio-c: var(--success-8);
104
+ --radiod-c: var(--success-8);
105
+ --radio-bg: var(--success-3);
106
+ --radio-bc: var(--success-4);
107
+ }
108
+
109
+ &.outlined {
110
+ --radio-bg: var(--base-1);
111
+
112
+ &.primary,
113
+ &.accent,
114
+ &.warn,
115
+ &.error,
116
+ &.success {
117
+ --radio-bc: var(--base-4);
118
+ }
119
+ }
120
+
121
+ &.flat,
122
+ &.raised {
123
+ --radio-c: #fff;
124
+ --radio-bc: var(--base-4);
125
+ --radio-bg: var(--base-2);
126
+ --radiod-c: #fff;
127
+ }
128
+
129
+ &.flat:has(input[type='radio']:checked),
130
+ &.flat.active {
131
+ --radio-bw: 0;
132
+ --radio-bg: var(--base-8);
133
+ --radiod-c: #fff;
134
+
135
+ &.primary {
136
+ --radio-bg: var(--primary-8);
137
+ }
138
+
139
+ &.accent {
140
+ --radio-bg: var(--accent-8);
141
+ }
142
+
143
+ &.warn {
144
+ --radio-bg: var(--warn-8);
145
+ }
146
+
147
+ &.error {
148
+ --radio-bg: var(--error-8);
149
+ }
150
+
151
+ &.success {
152
+ --radio-bg: var(--success-8);
153
+ }
154
+ }
155
+
156
+ &.raised:has(input[type='radio']:checked),
157
+ &.raised.active {
158
+ --radio-bw: 0;
159
+ --radio-bg: var(--base-g2);
160
+
161
+ &.primary {
162
+ --radio-bg: var(--primary-g2);
163
+ }
164
+
165
+ &.accent {
166
+ --radio-bg: var(--accent-g2);
167
+ }
168
+
169
+ &.warn {
170
+ --radio-bg: var(--warn-g2);
171
+ }
172
+
173
+ &.error {
174
+ --radio-bg: var(--error-g2);
175
+ }
176
+
177
+ &.success {
178
+ --radio-bg: var(--success-g2);
179
+ }
180
+ }
181
+ }
182
+ }