@uxf/ui 1.0.1 → 10.0.0-beta.4

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 (55) hide show
  1. package/chip/chip.d.ts +3 -1
  2. package/chip/chip.js +6 -5
  3. package/chip/chip.stories.js +27 -10
  4. package/chip/theme.d.ts +7 -0
  5. package/css/avatar-file-input.css +82 -0
  6. package/css/avatar.css +15 -0
  7. package/css/badge.css +23 -0
  8. package/css/button-group.css +22 -0
  9. package/css/button-list.css +61 -0
  10. package/css/button.css +335 -0
  11. package/css/calendar.css +215 -0
  12. package/css/checkbox-button.css +98 -0
  13. package/css/checkbox-input.css +24 -0
  14. package/css/checkbox.css +120 -0
  15. package/css/chip.css +591 -0
  16. package/css/color-radio-group.css +21 -0
  17. package/css/color-radio.css +33 -0
  18. package/css/component-structure-analyzer.css +31 -0
  19. package/css/date-picker.css +22 -0
  20. package/css/datetime-picker.css +11 -0
  21. package/css/dropdown.css +70 -0
  22. package/css/dropzone.css +85 -0
  23. package/css/error-message.css +3 -0
  24. package/css/file-input.css +80 -0
  25. package/css/flash-messages.css +28 -0
  26. package/css/form-component.css +7 -0
  27. package/css/icon.css +7 -0
  28. package/css/image-gallery.css +59 -0
  29. package/css/input-basic.css +18 -0
  30. package/css/input-with-popover.css +35 -0
  31. package/css/input.css +270 -0
  32. package/css/label.css +15 -0
  33. package/css/layout.css +47 -0
  34. package/css/list-item.css +29 -0
  35. package/css/loader.css +23 -0
  36. package/css/modal.css +65 -0
  37. package/css/multi-combobox.css +110 -0
  38. package/css/multi-select.css +27 -0
  39. package/css/pagination.css +93 -0
  40. package/css/paper.css +3 -0
  41. package/css/radio-group.css +169 -0
  42. package/css/radio.css +101 -0
  43. package/css/raster-image.css +20 -0
  44. package/css/select-base.css +50 -0
  45. package/css/tabs.css +131 -0
  46. package/css/text-link.css +12 -0
  47. package/css/textarea.css +124 -0
  48. package/css/time-picker.css +32 -0
  49. package/css/toggle.css +80 -0
  50. package/css/tooltip.css +7 -0
  51. package/css/typography.css +51 -0
  52. package/hooks/use-dropdown.d.ts +1 -1
  53. package/package.json +3 -2
  54. package/tooltip/use-tooltip.d.ts +1 -1
  55. package/utils/storybook-config.js +1 -1
package/css/layout.css ADDED
@@ -0,0 +1,47 @@
1
+ body {
2
+ @apply bg-neutral-100;
3
+ }
4
+
5
+ .uxf-layout {
6
+ &__content {
7
+ @apply flex flex-1 flex-col md:pl-64 pt-14;
8
+ }
9
+ }
10
+
11
+ .uxf-app-bar {
12
+ @apply fixed w-full top-0 left-0 flex items-center bg-primary-600 h-14;
13
+
14
+ &__left-container {
15
+ @apply flex items-center grow;
16
+ }
17
+
18
+ &__menu-button {
19
+ @apply px-5 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500 md:hidden;
20
+ }
21
+
22
+ &__logo {
23
+ @apply md:px-2;
24
+ }
25
+ }
26
+
27
+ .uxf-sidebar {
28
+ @apply hidden md:fixed md:inset-y-0 md:flex md:w-64 md:flex-col bg-white;
29
+
30
+ &__content {
31
+ @apply flex flex-grow flex-col overflow-y-auto border-r border-r-gray-200 pt-14;
32
+ }
33
+
34
+ &__logo {
35
+ @apply flex justify-center;
36
+ }
37
+ }
38
+
39
+ .uxf-drawer {
40
+ &__content {
41
+ @apply flex flex-grow flex-col overflow-y-auto border-r border-r-gray-200;
42
+ }
43
+
44
+ &__logo {
45
+ @apply flex justify-center;
46
+ }
47
+ }
@@ -0,0 +1,29 @@
1
+ .uxf-list-item {
2
+ @apply flex justify-between grow py-4 px-5 min-h-[64px] space-x-3 transition-opacity is-hoverable:opacity-75
3
+ outline-none relative before:absolute before:inset-0 before:rounded-lg focus-visible:before:border-2;
4
+
5
+ &__inner {
6
+ @apply w-full;
7
+ }
8
+
9
+ &__end-elements-wrapper,
10
+ &__end-icon-wrapper {
11
+ @apply shrink-0;
12
+ }
13
+
14
+ :root .light & {
15
+ @apply focus-visible:before:border-primary;
16
+
17
+ .uxf-list-item__end-icon-wrapper {
18
+ @apply text-gray-300;
19
+ }
20
+ }
21
+
22
+ :root .dark & {
23
+ @apply focus-visible:before:border-primary;
24
+
25
+ .uxf-list-item__end-icon-wrapper {
26
+ @apply text-gray-600;
27
+ }
28
+ }
29
+ }
package/css/loader.css ADDED
@@ -0,0 +1,23 @@
1
+ @keyframes spinner {
2
+ to {
3
+ transform: rotate(360deg);
4
+ }
5
+ }
6
+
7
+ .uxf-loader {
8
+ animation: spinner 1.2s linear infinite;
9
+
10
+ @apply inline-block rounded-full border-r-transparent border-t-current;
11
+
12
+ &--size-default {
13
+ @apply h-12 w-12 border-r-4 border-t-4;
14
+ }
15
+
16
+ &--size-lg {
17
+ @apply h-24 w-24 border-r-8 border-t-8;
18
+ }
19
+
20
+ &--size-sm {
21
+ @apply h-6 w-6 border-r-2 border-t-2;
22
+ }
23
+ }
package/css/modal.css ADDED
@@ -0,0 +1,65 @@
1
+ .uxf-modal {
2
+ position: relative;
3
+ z-index: theme("zIndex.modal");
4
+
5
+ &__backdrop {
6
+ @apply inset-0;
7
+
8
+ position: fixed;
9
+ background-color: rgb(0 0 0 / 75%);
10
+ }
11
+
12
+ &__wrapper {
13
+ @apply inset-0;
14
+
15
+ position: fixed;
16
+ overflow-y: auto;
17
+ }
18
+
19
+ &__body {
20
+ display: flex;
21
+ min-height: 100%;
22
+ align-items: flex-end;
23
+ justify-content: center;
24
+ padding-top: theme("spacing.8");
25
+
26
+ @media screen(sm) {
27
+ align-items: center;
28
+ padding: theme("spacing.4");
29
+ }
30
+ }
31
+
32
+ &__panel {
33
+ position: relative;
34
+ width: 100%;
35
+ border-top-left-radius: theme("borderRadius.2xl");
36
+ border-top-right-radius: theme("borderRadius.2xl");
37
+ overflow: hidden;
38
+
39
+ :root .light & {
40
+ background-color: theme("colors.white");
41
+ color: theme("colors.black");
42
+ }
43
+
44
+ :root .dark & {
45
+ background-color: theme("colors.gray.900");
46
+ color: theme("colors.white");
47
+ }
48
+
49
+ @media screen(sm) {
50
+ border-radius: theme("borderRadius.2xl");
51
+ }
52
+ }
53
+
54
+ &--width-sm .uxf-modal__panel {
55
+ max-width: theme("maxWidth.sm");
56
+ }
57
+
58
+ &--width-default .uxf-modal__panel {
59
+ max-width: theme("maxWidth.lg");
60
+ }
61
+
62
+ &--width-lg .uxf-modal__panel {
63
+ max-width: theme("maxWidth.3xl");
64
+ }
65
+ }
@@ -0,0 +1,110 @@
1
+ .uxf-multi-combobox {
2
+ @apply relative;
3
+
4
+ &__button {
5
+ min-height: theme("inputSize.default");
6
+
7
+ @apply relative flex flex-row w-full cursor-default flex-wrap items-center rounded-lg pl-3 pr-8 pb-[7px]
8
+ text-left outline-none before:absolute before:inset-0 before:pointer-events-none before:border
9
+ before:rounded-lg shadow-sm;
10
+
11
+ &--with-popover {
12
+ @apply cursor-text pb-0;
13
+ }
14
+
15
+ .uxf-icon {
16
+ @apply absolute top-1/2 -translate-y-1/2 right-3;
17
+
18
+ :root .light & {
19
+ @apply text-lightLow;
20
+ }
21
+
22
+ :root .dark & {
23
+ @apply text-darkLow;
24
+ }
25
+ }
26
+
27
+ :root .light & {
28
+ @apply bg-white text-lightHigh before:border-gray-200;
29
+
30
+ .is-empty {
31
+ @apply text-lightLow;
32
+ }
33
+ }
34
+
35
+ :root .dark & {
36
+ @apply bg-gray-800 text-darkHigh before:border-gray-700;
37
+
38
+ .is-empty {
39
+ @apply text-darkLow;
40
+ }
41
+ }
42
+
43
+ &.is-focused,
44
+ &:focus-visible {
45
+ @apply ring-2;
46
+
47
+ :root .light & {
48
+ @apply before:border-none ring-primary;
49
+ }
50
+
51
+ :root .dark & {
52
+ @apply ring-primary;
53
+ }
54
+ }
55
+
56
+ &.is-invalid {
57
+ @apply ring-1;
58
+
59
+ :root .light & {
60
+ @apply ring-error text-error;
61
+
62
+ .uxf-combobox__input {
63
+ @apply placeholder:text-error;
64
+ }
65
+ }
66
+
67
+ :root .dark & {
68
+ @apply ring-error text-error;
69
+
70
+ .uxf-combobox__input {
71
+ @apply placeholder:text-error;
72
+ }
73
+ }
74
+ }
75
+ }
76
+
77
+ &__input {
78
+ @apply bg-inherit focus-visible:ring-0 focus-visible:border-0 focus-visible:outline-none
79
+ shrink grow truncate;
80
+
81
+ margin-top: 7px;
82
+
83
+ &-placeholder {
84
+ &--with-popover {
85
+ @apply text-gray-400;
86
+ }
87
+ }
88
+
89
+ &--with-popover {
90
+ @apply my-1;
91
+ }
92
+
93
+ :root .light & {
94
+ @apply placeholder:text-lightLow;
95
+ }
96
+
97
+ :root .dark & {
98
+ @apply placeholder:text-darkLow;
99
+ }
100
+ }
101
+
102
+ &__input-chip {
103
+ margin-right: theme("spacing.2");
104
+ margin-top: 7px;
105
+ }
106
+
107
+ &__popover-panel {
108
+ @apply absolute top-0 left-0 z-10 w-full;
109
+ }
110
+ }
@@ -0,0 +1,27 @@
1
+ .uxf-multi-select {
2
+ &__input {
3
+ @apply overflow-hidden;
4
+
5
+ &--is-empty {
6
+ @apply mt-[7px] truncate;
7
+
8
+ :root .light & {
9
+ @apply text-lightLow;
10
+ }
11
+
12
+ :root .dark & {
13
+ @apply text-darkLow;
14
+ }
15
+ }
16
+ }
17
+
18
+ &__dropdown-item {
19
+ :root .light & {
20
+ @apply hover:bg-primary hover:text-white;
21
+ }
22
+
23
+ :root .dark & {
24
+ @apply hover:bg-primary;
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,93 @@
1
+ .uxf-pagination {
2
+ @apply isolate inline-flex rounded-md -space-x-px;
3
+
4
+ &__button {
5
+ @apply relative inline-flex items-center border text-sm font-medium focus:z-10 cursor-pointer;
6
+
7
+ :root .light & {
8
+ @apply border-gray-300 bg-white text-gray-500 hover:bg-gray-50;
9
+ }
10
+
11
+ :root .dark & {
12
+ @apply border-gray-600 bg-gray-900 text-gray-200 hover:bg-gray-800;
13
+ }
14
+
15
+ &.is-selected {
16
+ @apply z-10;
17
+
18
+ :root .light & {
19
+ @apply bg-indigo-50 border border-primary text-primary-600;
20
+ }
21
+
22
+ :root .dark & {
23
+ @apply bg-indigo-900/20 border border-primary-700 text-primary-300;
24
+ }
25
+ }
26
+
27
+ &.is-first {
28
+ @apply rounded-l-md;
29
+ }
30
+
31
+ &.is-last {
32
+ @apply rounded-r-md;
33
+ }
34
+
35
+ &.is-disabled {
36
+ @apply cursor-not-allowed;
37
+
38
+ :root .light & {
39
+ @apply text-neutral-300 hover:bg-white;
40
+ }
41
+
42
+ :root .dark & {
43
+ @apply text-neutral-500 hover:bg-gray-800;
44
+ }
45
+ }
46
+
47
+ &.is-ellipsis {
48
+ @apply pointer-events-none;
49
+
50
+ :root .light & {
51
+ @apply text-neutral-300 hover:bg-white;
52
+ }
53
+
54
+ :root .dark & {
55
+ @apply text-neutral-500 hover:bg-gray-800;
56
+ }
57
+ }
58
+ }
59
+
60
+ &__label {
61
+ @apply sr-only;
62
+ }
63
+
64
+ &--size-xs .uxf-pagination__button {
65
+ height: theme("inputSize.xs");
66
+
67
+ @apply px-2;
68
+ }
69
+
70
+ &--size-sm .uxf-pagination__button {
71
+ height: theme("inputSize.sm");
72
+
73
+ @apply px-3;
74
+ }
75
+
76
+ &--size-default .uxf-pagination__button {
77
+ height: theme("inputSize.default");
78
+
79
+ @apply px-4;
80
+ }
81
+
82
+ &--size-lg .uxf-pagination__button {
83
+ height: theme("inputSize.lg");
84
+
85
+ @apply px-5;
86
+ }
87
+
88
+ &--size-xl .uxf-pagination__button {
89
+ height: theme("inputSize.xl");
90
+
91
+ @apply px-6;
92
+ }
93
+ }
package/css/paper.css ADDED
@@ -0,0 +1,3 @@
1
+ .uxf-paper {
2
+ @apply bg-white rounded-lg shadow-paper;
3
+ }
@@ -0,0 +1,169 @@
1
+ .uxf-radio-group {
2
+ &__option {
3
+ @apply outline-none focus-visible:ring-offset-2 focus-visible:ring-2 focus-visible:rounded-lg;
4
+ }
5
+
6
+ &__option-wrapper {
7
+ @apply flex justify-between;
8
+ }
9
+
10
+ &__option-label {
11
+ @apply line-clamp-2;
12
+ }
13
+
14
+ &__label {
15
+ @apply mb-2;
16
+ }
17
+
18
+ :root .light & {
19
+ .uxf-radio-group__option {
20
+ @apply focus-visible:ring-primary focus-visible:ring-offset-white;
21
+ }
22
+
23
+ .uxf-radio-group__option-label {
24
+ @apply text-gray-600;
25
+ }
26
+
27
+ .uxf-radio-group__option-wrapper {
28
+ &.is-selected {
29
+ .uxf-radio-group__option-label {
30
+ @apply text-gray-900;
31
+ }
32
+ }
33
+ }
34
+ }
35
+
36
+ :root .dark & {
37
+ .uxf-radio-group__option {
38
+ @apply focus-visible:ring-primary focus-visible:ring-offset-gray-900;
39
+ }
40
+
41
+ .uxf-radio-group__option-label {
42
+ @apply text-white/80;
43
+ }
44
+
45
+ .uxf-radio-group__option-wrapper {
46
+ &.is-selected {
47
+ .uxf-radio-group__option-label {
48
+ @apply text-white;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ .uxf-radio-group--list {
56
+ .uxf-radio-group__options-wrapper {
57
+ @apply divide-y;
58
+ }
59
+
60
+ .uxf-radio-group__option-wrapper {
61
+ @apply items-center py-4;
62
+ }
63
+
64
+ .uxf-radio-group__option-label {
65
+ @apply pr-4;
66
+ }
67
+
68
+ :root .light & {
69
+ .uxf-radio-group__options-wrapper {
70
+ @apply divide-gray-200;
71
+ }
72
+
73
+ .uxf-radio-group__option {
74
+ @apply focus-visible:ring-primary focus-visible:ring-offset-white;
75
+ }
76
+ }
77
+
78
+ :root .dark & {
79
+ .uxf-radio-group__options-wrapper {
80
+ @apply divide-gray-800;
81
+ }
82
+
83
+ .uxf-radio-group__option {
84
+ @apply focus-visible:ring-primary focus-visible:ring-offset-gray-900;
85
+ }
86
+ }
87
+ }
88
+
89
+ .uxf-radio-group--radioButton {
90
+ .uxf-radio-group__options-wrapper {
91
+ @apply flex flex-wrap gap-2;
92
+ }
93
+
94
+ .uxf-radio-group__option-wrapper {
95
+ @apply flex-col-reverse min-w-[112px] p-3 relative
96
+ before:absolute before:inset-0 before:pointer-events-none before:border before:rounded-lg;
97
+
98
+ &.is-selected {
99
+ @apply before:border-2;
100
+ }
101
+ }
102
+
103
+ .uxf-radio-group__option-label {
104
+ @apply pt-4 text-sm;
105
+ }
106
+
107
+ :root .light & {
108
+ .uxf-radio-group__option {
109
+ @apply focus-visible:ring-primary;
110
+ }
111
+
112
+ .uxf-radio-group__option__wrapper {
113
+ @apply before:border-gray-400;
114
+
115
+ &.is-selected {
116
+ @apply before:border-primary;
117
+ }
118
+ }
119
+ }
120
+
121
+ :root .dark & {
122
+ .uxf-radio-group__option {
123
+ @apply focus-visible:ring-primary focus-visible:ring-offset-gray-900;
124
+ }
125
+
126
+ .uxf-radio-group__option-wrapper {
127
+ @apply border-gray-400;
128
+
129
+ &.is-selected {
130
+ @apply before:border-primary;
131
+ }
132
+ }
133
+ }
134
+ }
135
+
136
+ .uxf-radio-group--column,
137
+ .uxf-radio-group--row {
138
+ .uxf-radio-group__option-wrapper {
139
+ @apply flex-row-reverse items-center;
140
+ }
141
+
142
+ .uxf-radio-group__option-label {
143
+ @apply pl-2;
144
+ }
145
+
146
+ :root .light & {
147
+ .uxf-radio-group__option {
148
+ @apply focus-visible:ring-primary focus-visible:ring-offset-white;
149
+ }
150
+ }
151
+
152
+ :root .dark & {
153
+ .uxf-radio-group__option {
154
+ @apply focus-visible:ring-primary focus-visible:ring-offset-gray-900;
155
+ }
156
+ }
157
+ }
158
+
159
+ .uxf-radio-group--column {
160
+ .uxf-radio-group__options-wrapper {
161
+ @apply flex flex-col items-start space-y-2;
162
+ }
163
+ }
164
+
165
+ .uxf-radio-group--row {
166
+ .uxf-radio-group__options-wrapper {
167
+ @apply flex items-center space-x-10;
168
+ }
169
+ }
package/css/radio.css ADDED
@@ -0,0 +1,101 @@
1
+ .uxf-radio {
2
+ @apply flex shrink-0 items-center justify-center border rounded-full transition focus-visible:ring-2;
3
+
4
+ &__inner {
5
+ @apply block rounded-full opacity-0 transition;
6
+ }
7
+
8
+ &.is-selected {
9
+ .uxf-radio__inner {
10
+ @apply opacity-100;
11
+ }
12
+ }
13
+
14
+ &--size-default {
15
+ @apply h-4 w-4;
16
+
17
+ .uxf-radio__inner {
18
+ @apply w-1.5 h-1.5;
19
+ }
20
+ }
21
+
22
+ &--size-lg {
23
+ @apply h-6 w-6;
24
+
25
+ .uxf-radio__inner {
26
+ @apply w-2.5 h-2.5;
27
+ }
28
+ }
29
+
30
+ :root .light & {
31
+ @apply border-gray-400 focus-visible:ring-primary;
32
+
33
+ &.is-selected {
34
+ @apply bg-primary border-none;
35
+
36
+ .uxf-radio__inner {
37
+ @apply bg-white;
38
+ }
39
+ }
40
+
41
+ &.is-disabled {
42
+ @apply border-gray-200 pointer-events-none;
43
+
44
+ &.is-selected {
45
+ @apply bg-gray-200;
46
+ }
47
+
48
+ .uxf-radio__inner {
49
+ @apply bg-gray-400;
50
+ }
51
+ }
52
+
53
+ &.is-invalid {
54
+ @apply border-error;
55
+
56
+ &.is-selected {
57
+ @apply bg-error;
58
+ }
59
+
60
+ .uxf-radio__inner {
61
+ @apply bg-white;
62
+ }
63
+ }
64
+ }
65
+
66
+ :root .dark & {
67
+ @apply border-gray-400 focus-visible:ring-primary focus-visible:ring-offset-gray-900;
68
+
69
+ &.is-selected {
70
+ @apply bg-primary border-none;
71
+
72
+ .uxf-radio__inner {
73
+ @apply bg-white;
74
+ }
75
+ }
76
+
77
+ &.is-disabled {
78
+ @apply border-gray-600 pointer-events-none;
79
+
80
+ &.is-selected {
81
+ @apply bg-gray-600;
82
+ }
83
+
84
+ .uxf-radio__inner {
85
+ @apply bg-gray-800;
86
+ }
87
+ }
88
+
89
+ &.is-invalid {
90
+ @apply border-error;
91
+
92
+ &.is-selected {
93
+ @apply bg-error;
94
+ }
95
+
96
+ .uxf-radio__inner {
97
+ @apply bg-white;
98
+ }
99
+ }
100
+ }
101
+ }
@@ -0,0 +1,20 @@
1
+ .uxf-raster-image {
2
+ @apply block w-full;
3
+
4
+ &--contain,
5
+ &--cover {
6
+ @apply relative;
7
+ }
8
+
9
+ &__img {
10
+ @apply block w-full h-auto;
11
+
12
+ &--contain {
13
+ @apply absolute inset-0 h-full object-contain;
14
+ }
15
+
16
+ &--cover {
17
+ @apply absolute inset-0 h-full object-cover;
18
+ }
19
+ }
20
+ }