@companix/uikit 0.0.3 → 0.0.5

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 (165) hide show
  1. package/dist/Button/Button.scss +128 -0
  2. package/dist/ButtonGroup/ButtonGroup.scss +18 -0
  3. package/dist/Checkbox/Checkbox.scss +115 -0
  4. package/dist/DateInput/DateInput.scss +11 -0
  5. package/dist/DatePicker/Calendar.scss +125 -0
  6. package/dist/DatePicker/DatePicker.scss +0 -0
  7. package/dist/Dialog/Dialog.scss +25 -0
  8. package/dist/Dialog/Popup.scss +55 -0
  9. package/dist/DialogAlert/Alert.scss +52 -0
  10. package/dist/Drawer/Drawer.scss +112 -0
  11. package/dist/Form/Form.scss +70 -0
  12. package/dist/Form/Input.scss +24 -0
  13. package/dist/Icon/icon.scss +18 -0
  14. package/dist/OptionItem/Option.scss +89 -0
  15. package/dist/Popover/Popover.scss +80 -0
  16. package/dist/Radio/Radio.scss +148 -0
  17. package/dist/Scrollable/Scrollable.scss +50 -0
  18. package/dist/Select/Select.scss +80 -0
  19. package/dist/SelectTags/SelectTags.scss +66 -0
  20. package/dist/Spinner/Spinner.scss +14 -0
  21. package/dist/Stepper/StepperInput.scss +35 -0
  22. package/dist/Switch/Switch.scss +102 -0
  23. package/dist/Tabs/Tabs.scss +58 -0
  24. package/dist/TextArea/TextArea.scss +34 -0
  25. package/dist/Toaster/Toaster.scss +151 -0
  26. package/dist/Tooltip/Tooltip.scss +28 -0
  27. package/dist/bundle.es.js +56 -59
  28. package/dist/bundle.es10.js +35 -84
  29. package/dist/bundle.es11.js +30 -72
  30. package/dist/bundle.es12.js +14 -34
  31. package/dist/bundle.es13.js +7 -30
  32. package/dist/bundle.es14.js +33 -16
  33. package/dist/bundle.es15.js +24 -8
  34. package/dist/bundle.es16.js +15 -27
  35. package/dist/bundle.es17.js +22 -25
  36. package/dist/bundle.es18.js +13 -21
  37. package/dist/bundle.es19.js +38 -22
  38. package/dist/bundle.es2.js +45 -0
  39. package/dist/bundle.es20.js +16 -13
  40. package/dist/bundle.es21.js +34 -39
  41. package/dist/bundle.es22.js +20 -15
  42. package/dist/bundle.es23.js +38 -32
  43. package/dist/bundle.es24.js +110 -20
  44. package/dist/bundle.es25.js +106 -34
  45. package/dist/bundle.es26.js +34 -110
  46. package/dist/bundle.es27.js +11 -113
  47. package/dist/bundle.es28.js +23 -34
  48. package/dist/bundle.es29.js +35 -10
  49. package/dist/bundle.es3.js +10 -42
  50. package/dist/bundle.es30.js +20 -21
  51. package/dist/bundle.es31.js +81 -36
  52. package/dist/bundle.es32.js +20 -0
  53. package/dist/bundle.es33.js +16 -0
  54. package/dist/bundle.es34.js +24 -0
  55. package/dist/bundle.es35.js +5 -41
  56. package/dist/bundle.es36.js +18 -437
  57. package/dist/bundle.es37.js +14 -22
  58. package/dist/bundle.es38.js +68 -22
  59. package/dist/bundle.es39.js +68 -81
  60. package/dist/bundle.es4.js +85 -12
  61. package/dist/bundle.es40.js +31 -17
  62. package/dist/bundle.es41.js +67 -13
  63. package/dist/{bundle.es53.js → bundle.es42.js} +1 -1
  64. package/dist/bundle.es43.js +31 -5
  65. package/dist/bundle.es44.js +74 -20
  66. package/dist/bundle.es45.js +47 -12
  67. package/dist/bundle.es5.js +82 -83
  68. package/dist/bundle.es6.js +74 -81
  69. package/dist/bundle.es7.js +26 -78
  70. package/dist/bundle.es8.js +80 -22
  71. package/dist/bundle.es9.js +71 -43
  72. package/dist/css-properties.scss +120 -0
  73. package/dist/{types/index.d.ts → index.d.ts} +0 -1
  74. package/dist/index.scss +25 -0
  75. package/dist/mixins.scss +100 -0
  76. package/dist/theme.scss +101 -0
  77. package/package.json +3 -3
  78. package/dist/bundle.es46.js +0 -72
  79. package/dist/bundle.es47.js +0 -70
  80. package/dist/bundle.es48.js +0 -34
  81. package/dist/bundle.es49.js +0 -70
  82. package/dist/bundle.es50.js +0 -33
  83. package/dist/bundle.es51.js +0 -78
  84. package/dist/bundle.es52.js +0 -51
  85. package/dist/bundle.es54.js +0 -40
  86. package/dist/bundle.es55.js +0 -36
  87. package/dist/bundle.es56.js +0 -9
  88. package/dist/bundle.es57.js +0 -9
  89. package/dist/bundle.es58.js +0 -7
  90. package/dist/bundle.es59.js +0 -9
  91. package/dist/bundle.es60.js +0 -8
  92. package/dist/bundle.es61.js +0 -19
  93. package/dist/bundle.es62.js +0 -15
  94. package/dist/bundle.es63.js +0 -22
  95. package/dist/bundle.es64.js +0 -45
  96. package/dist/bundle.es65.js +0 -28
  97. package/dist/bundle.es66.js +0 -34
  98. package/dist/bundle.es67.js +0 -6
  99. package/dist/bundle.es68.js +0 -12
  100. package/dist/bundle.es69.js +0 -47
  101. package/dist/bundle.es70.js +0 -11
  102. package/dist/bundle.es71.js +0 -18
  103. package/dist/bundle.es72.js +0 -32
  104. package/dist/bundle.es73.js +0 -35
  105. package/dist/bundle.es74.js +0 -6
  106. package/dist/bundle.es75.js +0 -7
  107. package/dist/bundle.es76.js +0 -7
  108. package/dist/bundle.es77.js +0 -11
  109. package/dist/bundle.es78.js +0 -17
  110. package/dist/bundle.es79.js +0 -7
  111. package/dist/bundle.es80.js +0 -17
  112. package/dist/bundle.es81.js +0 -25
  113. package/dist/uikit.css +0 -1
  114. /package/dist/{types/Button → Button}/index.d.ts +0 -0
  115. /package/dist/{types/ButtonGroup → ButtonGroup}/index.d.ts +0 -0
  116. /package/dist/{types/Checkbox → Checkbox}/index.d.ts +0 -0
  117. /package/dist/{types/Countdown → Countdown}/index.d.ts +0 -0
  118. /package/dist/{types/DateInput → DateInput}/index.d.ts +0 -0
  119. /package/dist/{types/DatePicker → DatePicker}/Calendar.d.ts +0 -0
  120. /package/dist/{types/DatePicker → DatePicker}/CalendarHeader.d.ts +0 -0
  121. /package/dist/{types/DatePicker → DatePicker}/index.d.ts +0 -0
  122. /package/dist/{types/Dialog → Dialog}/index.d.ts +0 -0
  123. /package/dist/{types/DialogAlert → DialogAlert}/Alert.d.ts +0 -0
  124. /package/dist/{types/DialogAlert → DialogAlert}/Viewport.d.ts +0 -0
  125. /package/dist/{types/DialogAlert → DialogAlert}/index.d.ts +0 -0
  126. /package/dist/{types/Drawer → Drawer}/index.d.ts +0 -0
  127. /package/dist/{types/File → File}/index.d.ts +0 -0
  128. /package/dist/{types/Form → Form}/index.d.ts +0 -0
  129. /package/dist/{types/Icon → Icon}/index.d.ts +0 -0
  130. /package/dist/{types/LoadButton → LoadButton}/index.d.ts +0 -0
  131. /package/dist/{types/NumberInput → NumberInput}/index.d.ts +0 -0
  132. /package/dist/{types/OptionItem → OptionItem}/OptionItem.d.ts +0 -0
  133. /package/dist/{types/OptionItem → OptionItem}/OptionsList.d.ts +0 -0
  134. /package/dist/{types/Popover → Popover}/index.d.ts +0 -0
  135. /package/dist/{types/Radio → Radio}/index.d.ts +0 -0
  136. /package/dist/{types/Scrollable → Scrollable}/ImitateScroll.d.ts +0 -0
  137. /package/dist/{types/Scrollable → Scrollable}/index.d.ts +0 -0
  138. /package/dist/{types/Select → Select}/SelectInput.d.ts +0 -0
  139. /package/dist/{types/Select → Select}/index.d.ts +0 -0
  140. /package/dist/{types/SelectTags → SelectTags}/index.d.ts +0 -0
  141. /package/dist/{types/Spinner → Spinner}/index.d.ts +0 -0
  142. /package/dist/{types/Stepper → Stepper}/index.d.ts +0 -0
  143. /package/dist/{types/Switch → Switch}/index.d.ts +0 -0
  144. /package/dist/{types/Tabs → Tabs}/index.d.ts +0 -0
  145. /package/dist/{types/TextArea → TextArea}/index.d.ts +0 -0
  146. /package/dist/{types/Toaster → Toaster}/RemoveListener.d.ts +0 -0
  147. /package/dist/{types/Toaster → Toaster}/Toast.d.ts +0 -0
  148. /package/dist/{types/Toaster → Toaster}/Viewport.d.ts +0 -0
  149. /package/dist/{types/Toaster → Toaster}/index.d.ts +0 -0
  150. /package/dist/{types/Tooltip → Tooltip}/index.d.ts +0 -0
  151. /package/dist/{types/__hooks → __hooks}/use-frooze-closing.d.ts +0 -0
  152. /package/dist/{types/__hooks → __hooks}/use-loading.d.ts +0 -0
  153. /package/dist/{types/__hooks → __hooks}/use-local-storage.d.ts +0 -0
  154. /package/dist/{types/__hooks → __hooks}/use-popover-position.d.ts +0 -0
  155. /package/dist/{types/__hooks → __hooks}/use-previos.d.ts +0 -0
  156. /package/dist/{types/__hooks → __hooks}/use-resize.d.ts +0 -0
  157. /package/dist/{types/__hooks → __hooks}/use-scrollbox.d.ts +0 -0
  158. /package/dist/{types/__hooks → __hooks}/use-stepper-input.d.ts +0 -0
  159. /package/dist/{types/__hooks → __hooks}/use-update.d.ts +0 -0
  160. /package/dist/{types/__hooks → __hooks}/useCalendar.d.ts +0 -0
  161. /package/dist/{types/__hooks → __hooks}/useCalendarOptions-copy.d.ts +0 -0
  162. /package/dist/{types/__hooks → __hooks}/useCalendarOptions.d.ts +0 -0
  163. /package/dist/{types/__libs → __libs}/calendar.d.ts +0 -0
  164. /package/dist/{types/__utils → __utils}/utils.d.ts +0 -0
  165. /package/dist/{types/types.d.ts → types.d.ts} +0 -0
@@ -0,0 +1,58 @@
1
+ @use '../mixins.scss';
2
+
3
+ .tabs {
4
+ display: flex;
5
+ align-items: flex-end;
6
+ flex: 0 0 auto;
7
+ position: relative;
8
+
9
+ @include mixins.use-styles(tab, container);
10
+ }
11
+
12
+ .tab-indicator-container {
13
+ left: 0;
14
+ pointer-events: none;
15
+ position: absolute;
16
+ top: 0;
17
+
18
+ @include mixins.use-styles(tab, indicator, container);
19
+ }
20
+
21
+ .tab-indicator {
22
+ position: absolute;
23
+ bottom: 0;
24
+ left: 0;
25
+ right: 0;
26
+
27
+ @include mixins.use-styles(tab, indicator);
28
+ }
29
+
30
+ .tab {
31
+ outline: none;
32
+ font-family: inherit;
33
+ flex: 1;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+ line-height: 1;
38
+ background-color: transparent;
39
+ user-select: none;
40
+ position: relative;
41
+ cursor: pointer;
42
+ font-family: inherit;
43
+
44
+ @include mixins.use-styles(tab);
45
+
46
+ &[data-disabled] {
47
+ cursor: not-allowed;
48
+ @include mixins.use-styles(tab, disabled);
49
+ }
50
+
51
+ &:not([data-disabled]):not([data-state='active']):hover {
52
+ @include mixins.use-styles(tab, hover);
53
+ }
54
+
55
+ &[data-state='active'] {
56
+ @include mixins.use-styles(tab, active);
57
+ }
58
+ }
@@ -0,0 +1,34 @@
1
+ .form-textarea {
2
+ display: flex;
3
+
4
+ textarea {
5
+ padding: var(--form_space-y, 0px) var(--form_space, 0px);
6
+ border-radius: var(--form_border-radius);
7
+ border-style: solid;
8
+ border-width: 2px;
9
+ border-top-width: 0;
10
+ border-left-width: 0;
11
+ border-color: transparent;
12
+ min-height: max-content;
13
+ resize: vertical;
14
+ display: block;
15
+
16
+ ::-webkit-search-cancel-button {
17
+ display: none;
18
+ }
19
+
20
+ ::-webkit-search-decoration {
21
+ -webkit-appearance: none;
22
+ appearance: none;
23
+ }
24
+
25
+ ::-ms-clear {
26
+ display: none;
27
+ }
28
+
29
+ &[data-grow] {
30
+ resize: none;
31
+ border: none;
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,151 @@
1
+ @use '../mixins.scss';
2
+
3
+ @mixin use-appearance($appearance) {
4
+ &[data-appearance='#{$appearance}'] {
5
+ @include mixins.use-styles(toaster, $appearance);
6
+
7
+ .toaster {
8
+ &-icon {
9
+ @include mixins.use-styles(toaster, $appearance, icon);
10
+ }
11
+
12
+ &-title {
13
+ @include mixins.use-styles(toaster, $appearance, title);
14
+ }
15
+
16
+ &-description {
17
+ @include mixins.use-styles(toaster, $appearance, description);
18
+ }
19
+ }
20
+ }
21
+ }
22
+
23
+ .toaster {
24
+ pointer-events: all;
25
+ position: absolute;
26
+ outline: none;
27
+ opacity: 1;
28
+ transition: transform 0.4s, opacity 0.4s, height 0.4s, box-shadow 0.2s;
29
+ transform: var(--y);
30
+ display: flex;
31
+ align-items: center;
32
+
33
+ @include mixins.use-styles(toaster);
34
+
35
+ // appearance
36
+
37
+ @include use-appearance(primary);
38
+ @include use-appearance(neutral);
39
+ @include use-appearance(negative);
40
+ @include use-appearance(positive);
41
+ @include use-appearance(warning);
42
+
43
+ &[data-expanded]:not([data-mounted]) {
44
+ opacity: 0;
45
+ --y: translateY(calc(var(--lift) * -100% - var(--toaster_viewport_offset, 0)));
46
+ }
47
+
48
+ &[data-expanded][data-mounted] {
49
+ --y: translateY(calc(var(--lift) * var(--offset)));
50
+ }
51
+
52
+ &[data-state='closed'] {
53
+ animation: toastOut 400ms, toastFadeOut 400ms;
54
+ }
55
+
56
+ &-viewport {
57
+ position: fixed;
58
+ display: flex;
59
+ flex-direction: column;
60
+ left: var(--toaster_viewport_offset);
61
+ right: var(--toaster_viewport_offset);
62
+ z-index: 40;
63
+ outline: none;
64
+ pointer-events: none;
65
+ gap: var(--toasters-gap, 0);
66
+
67
+ &[data-side='top'] {
68
+ top: var(--toaster_viewport_offset);
69
+
70
+ .toaster {
71
+ --lift: 1;
72
+ top: 0;
73
+ }
74
+ }
75
+
76
+ &[data-side='bottom'] {
77
+ bottom: var(--toaster_viewport_offset);
78
+ top: auto;
79
+
80
+ .toaster {
81
+ --lift: -1;
82
+ bottom: 0;
83
+ }
84
+ }
85
+
86
+ &[data-align='center'] {
87
+ align-items: center;
88
+ }
89
+
90
+ &[data-align='right'] {
91
+ align-items: flex-end;
92
+ }
93
+
94
+ &[data-align='left'] {
95
+ align-items: flex-start;
96
+ }
97
+ }
98
+
99
+ &-content {
100
+ display: flex;
101
+ flex-direction: column;
102
+
103
+ @include mixins.use-styles(toaster, content);
104
+ }
105
+
106
+ &-title {
107
+ @include mixins.use-styles(toaster, title);
108
+ }
109
+
110
+ &-description {
111
+ @include mixins.use-styles(toaster, description);
112
+ }
113
+
114
+ &-close {
115
+ cursor: pointer;
116
+ top: var(--toaster_close_space, 0);
117
+ right: var(--toaster_close_space, 0);
118
+ position: absolute;
119
+ transition: color 0.2s;
120
+
121
+ @include mixins.use-styles(toaster, close);
122
+
123
+ &:hover {
124
+ @include mixins.use-styles(toaster, close, hover);
125
+ }
126
+
127
+ svg {
128
+ @include mixins.use-size(toaster, close, size);
129
+ }
130
+ }
131
+
132
+ &-icon {
133
+ @include mixins.use-styles(toaster, icon);
134
+
135
+ svg {
136
+ @include mixins.use-size(toaster, icon, size);
137
+ }
138
+ }
139
+ }
140
+
141
+ @keyframes toastOut {
142
+ to {
143
+ transform: translateY(calc(var(--lift) * -100% - var(--toaster_viewport_offset)));
144
+ }
145
+ }
146
+
147
+ @keyframes toastFadeOut {
148
+ to {
149
+ opacity: 0;
150
+ }
151
+ }
@@ -0,0 +1,28 @@
1
+ @use '../mixins.scss';
2
+
3
+ .tooltip .popover {
4
+ &-content {
5
+ @include mixins.use-styles(tooltip);
6
+ max-height: none;
7
+ }
8
+
9
+ &-arrow {
10
+ &-fill {
11
+ fill: mixins.get-var-name(tooltip, background);
12
+ }
13
+ }
14
+ }
15
+
16
+ .tooltip {
17
+ &[data-appearance='default'] {
18
+ &[data-state='open'] {
19
+ transform-origin: var(--radix-popover-content-transform-origin);
20
+ @include mixins.use-styles(tooltip, in);
21
+ }
22
+
23
+ &[data-state='closed'] {
24
+ transform-origin: var(--radix-popover-content-transform-origin);
25
+ @include mixins.use-styles(tooltip, out);
26
+ }
27
+ }
28
+ }
package/dist/bundle.es.js CHANGED
@@ -1,61 +1,58 @@
1
- /* empty css */
2
- import { Button as t } from "./bundle.es3.js";
3
- import { Spinner as m } from "./bundle.es4.js";
4
- import { Scrollable as f } from "./bundle.es5.js";
5
- import { ImitateScroll as l } from "./bundle.es6.js";
6
- import { Popover as n } from "./bundle.es7.js";
7
- import { Tooltip as u } from "./bundle.es8.js";
8
- import { StepperInput as s } from "./bundle.es9.js";
9
- import { Select as T } from "./bundle.es10.js";
10
- import { Form as A } from "./bundle.es11.js";
11
- import { OptionItem as I } from "./bundle.es12.js";
12
- import { NumberInput as w } from "./bundle.es13.js";
13
- import { OptionsList as L } from "./bundle.es14.js";
14
- import { ButtonGroup as h } from "./bundle.es15.js";
15
- import { Checkbox as v } from "./bundle.es16.js";
16
- import { Switch as F } from "./bundle.es17.js";
17
- import { Radio as y } from "./bundle.es18.js";
18
- import { Drawer as N } from "./bundle.es19.js";
19
- import { Dialog as j } from "./bundle.es20.js";
20
- import { AlertDialog as z } from "./bundle.es21.js";
21
- import { LoadButton as H } from "./bundle.es22.js";
22
- import { Tabs as K } from "./bundle.es23.js";
23
- import { Countdown as Q } from "./bundle.es24.js";
24
- import { TextArea as V } from "./bundle.es25.js";
25
- import { SelectTags as X } from "./bundle.es26.js";
26
- import { DatePicker as Z } from "./bundle.es27.js";
27
- import { FileOverlay as $ } from "./bundle.es28.js";
28
- import { useLocalStorage as ro } from "./bundle.es29.js";
29
- import { createAlertAgent as to } from "./bundle.es30.js";
30
- import { createToaster as mo } from "./bundle.es31.js";
1
+ import { Button as e } from "./bundle.es2.js";
2
+ import { Spinner as p } from "./bundle.es3.js";
3
+ import { Scrollable as x } from "./bundle.es4.js";
4
+ import { ImitateScroll as a } from "./bundle.es5.js";
5
+ import { Popover as i } from "./bundle.es6.js";
6
+ import { Tooltip as c } from "./bundle.es7.js";
7
+ import { Select as S } from "./bundle.es8.js";
8
+ import { Form as g } from "./bundle.es9.js";
9
+ import { OptionItem as b } from "./bundle.es10.js";
10
+ import { NumberInput as D } from "./bundle.es11.js";
11
+ import { OptionsList as w } from "./bundle.es12.js";
12
+ import { ButtonGroup as I } from "./bundle.es13.js";
13
+ import { Checkbox as O } from "./bundle.es14.js";
14
+ import { Switch as k } from "./bundle.es15.js";
15
+ import { Radio as C } from "./bundle.es16.js";
16
+ import { Drawer as P } from "./bundle.es17.js";
17
+ import { Dialog as G } from "./bundle.es18.js";
18
+ import { AlertDialog as R } from "./bundle.es19.js";
19
+ import { LoadButton as q } from "./bundle.es20.js";
20
+ import { Tabs as E } from "./bundle.es21.js";
21
+ import { Countdown as J } from "./bundle.es22.js";
22
+ import { TextArea as M } from "./bundle.es23.js";
23
+ import { SelectTags as U } from "./bundle.es24.js";
24
+ import { DatePicker as W } from "./bundle.es25.js";
25
+ import { FileOverlay as Y } from "./bundle.es26.js";
26
+ import { useLocalStorage as _ } from "./bundle.es27.js";
27
+ import { createAlertAgent as oo } from "./bundle.es28.js";
28
+ import { createToaster as eo } from "./bundle.es29.js";
31
29
  export {
32
- z as AlertDialog,
33
- t as Button,
34
- h as ButtonGroup,
35
- v as Checkbox,
36
- Q as Countdown,
37
- Z as DatePicker,
38
- j as Dialog,
39
- N as Drawer,
40
- $ as FileOverlay,
41
- A as Form,
42
- l as ImitateScroll,
43
- H as LoadButton,
44
- w as NumberInput,
45
- I as OptionItem,
46
- L as OptionsList,
47
- n as Popover,
48
- y as Radio,
49
- f as Scrollable,
50
- T as Select,
51
- X as SelectTags,
52
- m as Spinner,
53
- s as StepperInput,
54
- F as Switch,
55
- K as Tabs,
56
- V as TextArea,
57
- u as Tooltip,
58
- to as createAlertAgent,
59
- mo as createToaster,
60
- ro as useLocalStorage
30
+ R as AlertDialog,
31
+ e as Button,
32
+ I as ButtonGroup,
33
+ O as Checkbox,
34
+ J as Countdown,
35
+ W as DatePicker,
36
+ G as Dialog,
37
+ P as Drawer,
38
+ Y as FileOverlay,
39
+ g as Form,
40
+ a as ImitateScroll,
41
+ q as LoadButton,
42
+ D as NumberInput,
43
+ b as OptionItem,
44
+ w as OptionsList,
45
+ i as Popover,
46
+ C as Radio,
47
+ x as Scrollable,
48
+ S as Select,
49
+ U as SelectTags,
50
+ p as Spinner,
51
+ k as Switch,
52
+ E as Tabs,
53
+ M as TextArea,
54
+ c as Tooltip,
55
+ oo as createAlertAgent,
56
+ eo as createToaster,
57
+ _ as useLocalStorage
61
58
  };
@@ -1,87 +1,38 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useMemo as E, useEffect as I } from "react";
3
- import { OptionsList as b } from "./bundle.es14.js";
4
- import { OptionItem as B } from "./bundle.es12.js";
5
- import { Popover as F } from "./bundle.es7.js";
6
- import { useFroozeClosing as z } from "./bundle.es38.js";
7
- import { SelectInput as D } from "./bundle.es39.js";
8
- import { useScrollListController as L } from "./bundle.es40.js";
9
- const y = (c) => {
10
- const {
11
- options: e,
12
- onChange: i,
13
- minimalOptions: a,
14
- clearButton: m,
15
- clearButtonIcon: u,
16
- matchTarget: f = "width",
17
- value: l,
18
- children: n,
19
- disabled: s,
20
- ...d
21
- } = c, p = E(() => {
22
- const o = e.findIndex((t) => t.value === l);
23
- return {
24
- index: o,
25
- option: e[o]
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import N from "classnames";
3
+ import { Icon as v } from "./bundle.es34.js";
4
+ import { attr as t } from "@companix/utils-browser";
5
+ import { forwardRef as k } from "react";
6
+ import { faCheck as x } from "@fortawesome/free-solid-svg-icons";
7
+ const O = k(
8
+ ({ title: d, icon: n, active: c, label: e, disabled: r, minimal: a, onClick: l, className: m, ...s }, p) => {
9
+ const f = (h) => {
10
+ r || l?.(h);
26
11
  };
27
- }, [e, l]), v = p.option?.value ?? null, { popoverRef: h, froozePopoverPosition: x, handleAnimationEnd: O } = z(), { scrollToElement: C, optionsWrapperRef: g, scrollBoxRef: P } = L(), R = (o, t) => {
28
- x(), i(o), t();
29
- }, S = (o) => {
30
- o.stopPropagation(), i(null);
31
- }, A = () => {
32
- p.index !== -1 && C(p.index, !0);
33
- };
34
- return /* @__PURE__ */ r(
35
- F,
36
- {
37
- minimal: !0,
38
- ref: h,
39
- sideOffset: 0,
40
- matchTarget: f,
41
- onAnimationEnd: O,
42
- onOpenAutoFocus: (o) => o.preventDefault(),
43
- onCloseAutoFocus: (o) => o.preventDefault(),
44
- disabled: s,
45
- content: ({ close: o }) => /* @__PURE__ */ r(
46
- T,
47
- {
48
- options: e,
49
- active: v,
50
- scrollboxRef: P,
51
- optionsWrapperRef: g,
52
- minimalOptions: a,
53
- onOpened: A,
54
- onSelect: (t) => R(t, o)
55
- }
56
- ),
57
- children: n ?? /* @__PURE__ */ r(
58
- D,
59
- {
60
- ...d,
61
- disabled: s,
62
- value: p.option?.title ?? "",
63
- onClear: S,
64
- clearButton: m,
65
- clearButtonIcon: u
66
- }
67
- )
68
- }
69
- );
70
- }, T = (c) => {
71
- const { active: e, onOpened: i, scrollboxRef: a, optionsWrapperRef: m, options: u, onSelect: f, minimalOptions: l } = c;
72
- return I(() => {
73
- i?.();
74
- }, []), /* @__PURE__ */ r(b, { scrollboxRef: a, optionsWrapperRef: m, maxHeight: 300, children: u.map((n, s) => /* @__PURE__ */ r(
75
- B,
76
- {
77
- active: e === n.value,
78
- onClick: () => f?.(n.value),
79
- minimal: l,
80
- ...n
81
- },
82
- `option-item-${n.value}-${s}`
83
- )) });
84
- };
12
+ return /* @__PURE__ */ i(
13
+ "div",
14
+ {
15
+ ref: p,
16
+ ...s,
17
+ className: N("option", m),
18
+ "data-selected": t(c),
19
+ "data-disabled": t(r),
20
+ "data-minimal": t(a),
21
+ onClick: f,
22
+ children: [
23
+ /* @__PURE__ */ i("div", { className: "option-content", children: [
24
+ n && /* @__PURE__ */ o("div", { className: "option-icon", children: n }),
25
+ /* @__PURE__ */ i("div", { className: "option-content-layout", children: [
26
+ /* @__PURE__ */ o("div", { className: "option-title", children: d }),
27
+ e && /* @__PURE__ */ o("div", { className: "option-label", children: e })
28
+ ] })
29
+ ] }),
30
+ c && !a && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(v, { icon: x }) })
31
+ ]
32
+ }
33
+ );
34
+ }
35
+ );
85
36
  export {
86
- y as Select
37
+ O as OptionItem
87
38
  };
@@ -1,75 +1,33 @@
1
- import { jsxs as z, jsx as r } from "react/jsx-runtime";
2
- import A from "classnames";
3
- import F from "react-input-mask";
4
- import { useLayoutAndUpdate as M } from "./bundle.es41.js";
5
- import { attr as c } from "@companix/utils-browser";
6
- import { forwardRef as R, useRef as m, useCallback as g } from "react";
7
- import { mergeRefs as U } from "react-merge-refs";
8
- const Q = R(
9
- ({
10
- required: n,
11
- size: f,
12
- fill: a,
13
- leftElement: e,
14
- rightElement: u,
15
- onChange: x,
16
- onValueChange: $,
17
- readOnly: b,
18
- className: I,
19
- value: N,
20
- placeholder: W,
21
- disabled: p,
22
- mask: y,
23
- maskChar: C,
24
- inputRef: L,
25
- ...j
26
- }, k) => {
27
- const s = m(null), l = m(null), d = m(null), q = { Right: l, Left: d }, h = g((t) => {
28
- if (s.current) {
29
- const i = s.current.style, o = q[t];
30
- o.current && o.current.clientWidth ? i[`padding${t}`] !== `${o.current.clientWidth}px` && (i[`padding${t}`] = `${o.current.clientWidth}px`) : i[`padding${t}`] && (i[`padding${t}`] = "");
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useState as m, useRef as p } from "react";
3
+ import { Form as l } from "./bundle.es9.js";
4
+ const N = ({ value: r, onChange: u, ...e }) => {
5
+ const [, t] = m([]), n = p(o(r));
6
+ return +n.current !== r && (n.current = o(r)), /* @__PURE__ */ f(
7
+ l,
8
+ {
9
+ ...e,
10
+ value: n.current,
11
+ onChange: (i) => {
12
+ const s = i.currentTarget.value.trim();
13
+ if (s === "")
14
+ return n.current = "", u(null);
15
+ if (!(s.startsWith(".") || s.replace(".", "").split("").some((c) => isNaN(parseInt(c))))) {
16
+ if (n.current = a(s.split("")), +n.current === r)
17
+ return t([]);
18
+ u(+n.current);
19
+ }
31
20
  }
32
- }, []);
33
- M(() => {
34
- h("Left"), h("Right");
35
- }, [u, e]);
36
- const w = g((t) => {
37
- x?.(t), $?.(t.target.value, t.target);
38
- }, []);
39
- return /* @__PURE__ */ z(
40
- "div",
41
- {
42
- ref: k,
43
- className: A("form", I),
44
- "data-size": f ?? "md",
45
- "data-fill": c(a),
46
- "data-required": c(n),
47
- "data-disabled": c(p),
48
- ...j,
49
- children: [
50
- e && /* @__PURE__ */ r("span", { ref: d, className: "form-input-base-left-element", children: e }),
51
- /* @__PURE__ */ r(
52
- v,
53
- {
54
- type: "text",
55
- ref: U([s, L]),
56
- className: "form-input form-input-base",
57
- "aria-disabled": p,
58
- onChange: w,
59
- value: N,
60
- placeholder: W,
61
- disabled: p,
62
- readOnly: b,
63
- maskChar: C,
64
- mask: y
65
- }
66
- ),
67
- u && /* @__PURE__ */ r("span", { ref: l, className: "form-input-base-right-element", children: u })
68
- ]
69
- }
70
- );
71
- }
72
- ), v = R(({ mask: n, maskChar: f, ...a }, e) => n ? /* @__PURE__ */ r(F, { inputRef: e, mask: n, maskChar: f, ...a }) : /* @__PURE__ */ r("input", { ref: e, ...a }));
21
+ }
22
+ );
23
+ }, o = (r) => r === null ? "" : r.toString(), a = (r) => {
24
+ const u = [...r], e = [...r];
25
+ if (e.every((t) => t === "0"))
26
+ return "0";
27
+ for (let t = 0; t < e.length && e[t] === "0"; t++)
28
+ e[t] === "0" && e[t + 1] !== "." && u.shift();
29
+ return u.join("");
30
+ };
73
31
  export {
74
- Q as Form
32
+ N as NumberInput
75
33
  };
@@ -1,38 +1,18 @@
1
- import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import N from "classnames";
3
- import { Icon as v } from "./bundle.es37.js";
4
- import { attr as t } from "@companix/utils-browser";
5
- import { forwardRef as k } from "react";
6
- import { faCheck as x } from "@fortawesome/free-solid-svg-icons";
7
- const O = k(
8
- ({ title: d, icon: n, active: c, label: e, disabled: r, minimal: a, onClick: l, className: m, ...s }, p) => {
9
- const f = (h) => {
10
- r || l?.(h);
11
- };
12
- return /* @__PURE__ */ i(
13
- "div",
14
- {
15
- ref: p,
16
- ...s,
17
- className: N("option", m),
18
- "data-selected": t(c),
19
- "data-disabled": t(r),
20
- "data-minimal": t(a),
21
- onClick: f,
22
- children: [
23
- /* @__PURE__ */ i("div", { className: "option-content", children: [
24
- n && /* @__PURE__ */ o("div", { className: "option-icon", children: n }),
25
- /* @__PURE__ */ i("div", { className: "option-content-layout", children: [
26
- /* @__PURE__ */ o("div", { className: "option-title", children: d }),
27
- e && /* @__PURE__ */ o("div", { className: "option-label", children: e })
28
- ] })
29
- ] }),
30
- c && !a && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(v, { icon: x }) })
31
- ]
32
- }
33
- );
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Scrollable as n } from "./bundle.es4.js";
3
+ const s = ({ children: o, maxHeight: t, scrollboxRef: i, optionsWrapperRef: e }) => /* @__PURE__ */ r(
4
+ n,
5
+ {
6
+ ref: i,
7
+ implementation: "inner",
8
+ padding: 10,
9
+ thumbPadding: 3,
10
+ thumbColor: "#0000002b",
11
+ maxHeight: t,
12
+ scrollY: !0,
13
+ children: /* @__PURE__ */ r("div", { className: "option-list", ref: e, children: o })
34
14
  }
35
15
  );
36
16
  export {
37
- O as OptionItem
17
+ s as OptionsList
38
18
  };