@jobber/components 9.4.0 → 9.5.1

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 (161) hide show
  1. package/dist/Autocomplete/index.cjs +0 -1
  2. package/dist/Autocomplete/index.mjs +0 -1
  3. package/dist/Card/index.cjs +7 -7
  4. package/dist/Card/index.mjs +7 -7
  5. package/dist/Chip/index.cjs +0 -1
  6. package/dist/Chip/index.mjs +0 -1
  7. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +0 -1
  8. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +0 -1
  9. package/dist/Chips/InternalChipDismissible/index.cjs +0 -1
  10. package/dist/Chips/InternalChipDismissible/index.mjs +0 -1
  11. package/dist/Chips/index.cjs +0 -1
  12. package/dist/Chips/index.mjs +0 -1
  13. package/dist/ComboboxChipRemove-cjs.js +181 -184
  14. package/dist/ComboboxChipRemove-es.js +4 -7
  15. package/dist/ConfirmationModal/index.cjs +0 -1
  16. package/dist/ConfirmationModal/index.mjs +0 -1
  17. package/dist/DataDump/index.cjs +7 -7
  18. package/dist/DataDump/index.mjs +7 -7
  19. package/dist/DataList/components/DataListActions/index.cjs +0 -1
  20. package/dist/DataList/components/DataListActions/index.mjs +0 -1
  21. package/dist/DataList/components/DataListBulkActions/index.cjs +0 -1
  22. package/dist/DataList/components/DataListBulkActions/index.mjs +0 -1
  23. package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +0 -1
  24. package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +0 -1
  25. package/dist/DataList/components/DataListFilters/index.cjs +0 -1
  26. package/dist/DataList/components/DataListFilters/index.mjs +0 -1
  27. package/dist/DataList/components/DataListHeader/index.cjs +0 -1
  28. package/dist/DataList/components/DataListHeader/index.mjs +0 -1
  29. package/dist/DataList/components/DataListItem/index.cjs +0 -1
  30. package/dist/DataList/components/DataListItem/index.mjs +0 -1
  31. package/dist/DataList/components/DataListItemActions/index.cjs +0 -1
  32. package/dist/DataList/components/DataListItemActions/index.mjs +0 -1
  33. package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +0 -1
  34. package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +0 -1
  35. package/dist/DataList/components/DataListItems/index.cjs +0 -1
  36. package/dist/DataList/components/DataListItems/index.mjs +0 -1
  37. package/dist/DataList/components/DataListLayout/index.cjs +0 -1
  38. package/dist/DataList/components/DataListLayout/index.mjs +0 -1
  39. package/dist/DataList/components/DataListLayoutActions/index.cjs +0 -1
  40. package/dist/DataList/components/DataListLayoutActions/index.mjs +0 -1
  41. package/dist/DataList/index.cjs +0 -1
  42. package/dist/DataList/index.mjs +0 -1
  43. package/dist/DatePicker/index.cjs +0 -2
  44. package/dist/DatePicker/index.mjs +0 -2
  45. package/dist/DatePicker-cjs.js +19 -18
  46. package/dist/DatePicker-es.js +2 -1
  47. package/dist/Dialog/index.cjs +11 -6
  48. package/dist/Dialog/index.mjs +11 -6
  49. package/dist/DrawerDescription-cjs.js +7 -8
  50. package/dist/DrawerDescription-es.js +1 -2
  51. package/dist/DrawerTitle-cjs.js +4 -4
  52. package/dist/DrawerTitle-es.js +1 -1
  53. package/dist/FieldDescription-cjs.js +49 -49
  54. package/dist/FieldDescription-es.js +2 -2
  55. package/dist/FilterPicker/components/FilterPickerActivator/index.cjs +0 -1
  56. package/dist/FilterPicker/components/FilterPickerActivator/index.mjs +0 -1
  57. package/dist/FilterPicker/components/FilterPickerContent/index.cjs +0 -1
  58. package/dist/FilterPicker/components/FilterPickerContent/index.mjs +0 -1
  59. package/dist/FilterPicker/components/FilterPickerTrigger/index.cjs +0 -1
  60. package/dist/FilterPicker/components/FilterPickerTrigger/index.mjs +0 -1
  61. package/dist/FilterPicker/index.cjs +0 -1
  62. package/dist/FilterPicker/index.mjs +0 -1
  63. package/dist/FormatFile/index.cjs +0 -1
  64. package/dist/FormatFile/index.mjs +0 -1
  65. package/dist/Gallery/index.cjs +0 -1
  66. package/dist/Gallery/index.mjs +0 -1
  67. package/dist/HelperText-cjs.js +3 -2
  68. package/dist/HelperText-es.js +3 -2
  69. package/dist/InputDate/index.cjs +0 -2
  70. package/dist/InputDate/index.mjs +0 -2
  71. package/dist/InputNumber/InputNumber.d.ts +75 -5
  72. package/dist/InputNumber/index.cjs +27 -3
  73. package/dist/InputNumber/index.d.ts +2 -2
  74. package/dist/InputNumber/index.mjs +27 -3
  75. package/dist/{primitives/InputNumberExperimental → InputNumber}/types.d.ts +48 -35
  76. package/dist/InputNumber-cjs.js +267 -4986
  77. package/dist/InputNumber-es.js +268 -4987
  78. package/dist/LightBox/index.cjs +0 -1
  79. package/dist/LightBox/index.mjs +0 -1
  80. package/dist/Menu/index.cjs +7 -7
  81. package/dist/Menu/index.mjs +7 -7
  82. package/dist/Menu-cjs.js +8 -5
  83. package/dist/Menu-es.js +8 -5
  84. package/dist/MenuSubmenuTrigger-cjs.js +142 -143
  85. package/dist/MenuSubmenuTrigger-es.js +5 -6
  86. package/dist/Modal/index.cjs +0 -1
  87. package/dist/Modal/index.mjs +0 -1
  88. package/dist/NumberFieldInput-cjs.js +63 -63
  89. package/dist/NumberFieldInput-es.js +5 -5
  90. package/dist/Page/index.cjs +7 -8
  91. package/dist/Page/index.mjs +7 -8
  92. package/dist/Popover/index.cjs +0 -1
  93. package/dist/Popover/index.mjs +0 -1
  94. package/dist/ScrollAreaViewport-cjs.js +119 -121
  95. package/dist/ScrollAreaViewport-es.js +3 -5
  96. package/dist/Select/index.cjs +3 -9
  97. package/dist/Select/index.mjs +3 -9
  98. package/dist/SelectGroupLabel-cjs.js +117 -107
  99. package/dist/SelectGroupLabel-es.js +20 -12
  100. package/dist/Tooltip/index.cjs +0 -1
  101. package/dist/Tooltip/index.mjs +0 -1
  102. package/dist/dialogReturnFocus-cjs.js +4 -1
  103. package/dist/dialogReturnFocus-es.js +4 -1
  104. package/dist/docs/InputNumber/InputNumber.md +564 -56
  105. package/dist/docs/index.md +0 -1
  106. package/dist/floating-ui.react-cjs.js +34 -35
  107. package/dist/floating-ui.react-dom-cjs.js +64 -65
  108. package/dist/floating-ui.react-dom-es.js +1 -2
  109. package/dist/floating-ui.react-es.js +1 -2
  110. package/dist/floating-ui.utils-cjs.js +183 -0
  111. package/dist/floating-ui.utils-es.js +165 -1
  112. package/dist/index.cjs +10 -15
  113. package/dist/index.mjs +10 -15
  114. package/dist/primitives/BottomSheet/index.cjs +2 -5
  115. package/dist/primitives/BottomSheet/index.mjs +2 -5
  116. package/dist/primitives/ComboboxPrimitive/index.cjs +3 -7
  117. package/dist/primitives/ComboboxPrimitive/index.mjs +3 -7
  118. package/dist/primitives/HelperText/HelperText.d.ts +4 -1
  119. package/dist/primitives/HelperText/index.cjs +1 -1
  120. package/dist/primitives/HelperText/index.mjs +1 -1
  121. package/dist/primitives/SelectPrimitive/index.cjs +3 -9
  122. package/dist/primitives/SelectPrimitive/index.mjs +3 -9
  123. package/dist/primitives/index.cjs +2 -16
  124. package/dist/primitives/index.d.ts +0 -2
  125. package/dist/primitives/index.mjs +2 -15
  126. package/dist/scrollEdges-cjs.js +6 -2
  127. package/dist/scrollEdges-es.js +5 -2
  128. package/dist/styles.css +573 -902
  129. package/dist/unstyledPrimitives/index.cjs +105 -111
  130. package/dist/unstyledPrimitives/index.mjs +5 -11
  131. package/dist/useCompositeListItem-cjs.js +516 -90
  132. package/dist/useCompositeListItem-es.js +407 -6
  133. package/dist/useLabel-cjs.js +10 -10
  134. package/dist/useLabel-es.js +3 -3
  135. package/dist/useRenderElement-es.js +1 -1
  136. package/dist/useScrollLock-cjs.js +1332 -203
  137. package/dist/useScrollLock-es.js +1068 -5
  138. package/dist/utils/meta/meta.json +12 -0
  139. package/package.json +2 -3
  140. package/dist/InputNumber/InputNumber.types.d.ts +0 -20
  141. package/dist/InputNumberExperimental-cjs.js +0 -277
  142. package/dist/InputNumberExperimental-es.js +0 -275
  143. package/dist/clamp-cjs.js +0 -7
  144. package/dist/clamp-es.js +0 -5
  145. package/dist/clsx-cjs.js +0 -5
  146. package/dist/clsx-es.js +0 -3
  147. package/dist/docs/InputNumberExperimental/InputNumberExperimental.md +0 -578
  148. package/dist/floating-ui.utils.dom-cjs.js +0 -185
  149. package/dist/floating-ui.utils.dom-es.js +0 -165
  150. package/dist/isElementDisabled-cjs.js +0 -40
  151. package/dist/isElementDisabled-es.js +0 -18
  152. package/dist/primitives/InputNumberExperimental/InputNumberExperimental.d.ts +0 -77
  153. package/dist/primitives/InputNumberExperimental/index.cjs +0 -30
  154. package/dist/primitives/InputNumberExperimental/index.d.ts +0 -2
  155. package/dist/primitives/InputNumberExperimental/index.mjs +0 -24
  156. package/dist/resolveAriaLabelledBy-cjs.js +0 -200
  157. package/dist/resolveAriaLabelledBy-es.js +0 -166
  158. package/dist/useButton-cjs.js +0 -1164
  159. package/dist/useButton-es.js +0 -1071
  160. package/dist/useLabelableId-cjs.js +0 -278
  161. package/dist/useLabelableId-es.js +0 -247
@@ -1,200 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var jsxRuntime = require('react/jsx-runtime');
5
-
6
- function _interopNamespaceDefault(e) {
7
- var n = Object.create(null);
8
- if (e) {
9
- Object.keys(e).forEach(function (k) {
10
- if (k !== 'default') {
11
- var d = Object.getOwnPropertyDescriptor(e, k);
12
- Object.defineProperty(n, k, d.get ? d : {
13
- enumerable: true,
14
- get: function () { return e[k]; }
15
- });
16
- }
17
- });
18
- }
19
- n.default = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
24
-
25
- const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
26
- function compareItemEquality(itemValue, selectedValue, comparer) {
27
- if (itemValue == null || selectedValue == null) {
28
- return Object.is(itemValue, selectedValue);
29
- }
30
- return comparer(itemValue, selectedValue);
31
- }
32
- function selectedValueIncludes(selectedValues, itemValue, comparer) {
33
- if (!selectedValues || selectedValues.length === 0) {
34
- return false;
35
- }
36
- return selectedValues.some(selectedValue => {
37
- if (selectedValue === undefined) {
38
- return false;
39
- }
40
- return compareItemEquality(itemValue, selectedValue, comparer);
41
- });
42
- }
43
- function findItemIndex(itemValues, selectedValue, comparer) {
44
- if (!itemValues || itemValues.length === 0) {
45
- return -1;
46
- }
47
- return itemValues.findIndex(itemValue => {
48
- if (itemValue === undefined) {
49
- return false;
50
- }
51
- return compareItemEquality(itemValue, selectedValue, comparer);
52
- });
53
- }
54
- function removeItem(selectedValues, itemValue, comparer) {
55
- return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));
56
- }
57
-
58
- function serializeValue(value) {
59
- if (value == null) {
60
- return '';
61
- }
62
- if (typeof value === 'string') {
63
- return value;
64
- }
65
- try {
66
- return JSON.stringify(value);
67
- } catch {
68
- return String(value);
69
- }
70
- }
71
-
72
- function isGroupedItems(items) {
73
- return items != null && items.length > 0 && typeof items[0] === 'object' && items[0] != null && 'items' in items[0];
74
- }
75
-
76
- /**
77
- * Checks if the items array contains an item with a null value that has a non-null label.
78
- */
79
- function hasNullItemLabel(items) {
80
- if (!Array.isArray(items)) {
81
- return items != null && 'null' in items;
82
- }
83
- const arrayItems = items;
84
- if (isGroupedItems(arrayItems)) {
85
- for (const group of arrayItems) {
86
- for (const item of group.items) {
87
- if (item && item.value == null && item.label != null) {
88
- return true;
89
- }
90
- }
91
- }
92
- return false;
93
- }
94
- for (const item of arrayItems) {
95
- if (item && item.value == null && item.label != null) {
96
- return true;
97
- }
98
- }
99
- return false;
100
- }
101
- function stringifyAsLabel(item, itemToStringLabel) {
102
- if (itemToStringLabel && item != null) {
103
- return itemToStringLabel(item) ?? '';
104
- }
105
- if (item && typeof item === 'object') {
106
- if ('label' in item && item.label != null) {
107
- return String(item.label);
108
- }
109
- if ('value' in item) {
110
- return String(item.value);
111
- }
112
- }
113
- return serializeValue(item);
114
- }
115
- function stringifyAsValue(item, itemToStringValue) {
116
- if (itemToStringValue && item != null) {
117
- return itemToStringValue(item) ?? '';
118
- }
119
- if (item && typeof item === 'object' && 'value' in item && 'label' in item) {
120
- return serializeValue(item.value);
121
- }
122
- return serializeValue(item);
123
- }
124
- function resolveSelectedLabel(value, items, itemToStringLabel) {
125
- function fallback() {
126
- return stringifyAsLabel(value, itemToStringLabel);
127
- }
128
- if (itemToStringLabel && value != null) {
129
- return itemToStringLabel(value);
130
- }
131
-
132
- // Custom object with explicit label takes precedence
133
- if (value && typeof value === 'object' && 'label' in value && value.label != null) {
134
- return value.label;
135
- }
136
-
137
- // Items provided as plain record map
138
- if (items && !Array.isArray(items)) {
139
- return items[value] ?? fallback();
140
- }
141
-
142
- // Items provided as array (flat or grouped)
143
- if (Array.isArray(items)) {
144
- const arrayItems = items;
145
- const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap(group => group.items) : arrayItems;
146
- if (value == null || typeof value !== 'object') {
147
- const match = flatItems.find(item => item.value === value);
148
- if (match && match.label != null) {
149
- return match.label;
150
- }
151
- return fallback();
152
- }
153
-
154
- // Object without explicit label: try matching by its `value` property
155
- if ('value' in value) {
156
- const match = flatItems.find(item => item && item.value === value.value);
157
- if (match && match.label != null) {
158
- return match.label;
159
- }
160
- }
161
- }
162
- return fallback();
163
- }
164
- function resolveMultipleLabels(values, items, itemToStringLabel) {
165
- return values.reduce((acc, value, index) => {
166
- if (index > 0) {
167
- acc.push(', ');
168
- }
169
- acc.push(/*#__PURE__*/jsxRuntime.jsx(React__namespace.Fragment, {
170
- children: resolveSelectedLabel(value, items, itemToStringLabel)
171
- }, index));
172
- return acc;
173
- }, []);
174
- }
175
-
176
- function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
177
- return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));
178
- }
179
-
180
- function getDefaultLabelId(id) {
181
- return id == null ? undefined : `${id}-label`;
182
- }
183
- function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
184
- return fieldLabelId ?? localLabelId;
185
- }
186
-
187
- exports.areArraysEqual = areArraysEqual;
188
- exports.compareItemEquality = compareItemEquality;
189
- exports.defaultItemEquality = defaultItemEquality;
190
- exports.findItemIndex = findItemIndex;
191
- exports.getDefaultLabelId = getDefaultLabelId;
192
- exports.hasNullItemLabel = hasNullItemLabel;
193
- exports.isGroupedItems = isGroupedItems;
194
- exports.removeItem = removeItem;
195
- exports.resolveAriaLabelledBy = resolveAriaLabelledBy;
196
- exports.resolveMultipleLabels = resolveMultipleLabels;
197
- exports.resolveSelectedLabel = resolveSelectedLabel;
198
- exports.selectedValueIncludes = selectedValueIncludes;
199
- exports.stringifyAsLabel = stringifyAsLabel;
200
- exports.stringifyAsValue = stringifyAsValue;
@@ -1,166 +0,0 @@
1
- import * as React from 'react';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
5
- function compareItemEquality(itemValue, selectedValue, comparer) {
6
- if (itemValue == null || selectedValue == null) {
7
- return Object.is(itemValue, selectedValue);
8
- }
9
- return comparer(itemValue, selectedValue);
10
- }
11
- function selectedValueIncludes(selectedValues, itemValue, comparer) {
12
- if (!selectedValues || selectedValues.length === 0) {
13
- return false;
14
- }
15
- return selectedValues.some(selectedValue => {
16
- if (selectedValue === undefined) {
17
- return false;
18
- }
19
- return compareItemEquality(itemValue, selectedValue, comparer);
20
- });
21
- }
22
- function findItemIndex(itemValues, selectedValue, comparer) {
23
- if (!itemValues || itemValues.length === 0) {
24
- return -1;
25
- }
26
- return itemValues.findIndex(itemValue => {
27
- if (itemValue === undefined) {
28
- return false;
29
- }
30
- return compareItemEquality(itemValue, selectedValue, comparer);
31
- });
32
- }
33
- function removeItem(selectedValues, itemValue, comparer) {
34
- return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));
35
- }
36
-
37
- function serializeValue(value) {
38
- if (value == null) {
39
- return '';
40
- }
41
- if (typeof value === 'string') {
42
- return value;
43
- }
44
- try {
45
- return JSON.stringify(value);
46
- } catch {
47
- return String(value);
48
- }
49
- }
50
-
51
- function isGroupedItems(items) {
52
- return items != null && items.length > 0 && typeof items[0] === 'object' && items[0] != null && 'items' in items[0];
53
- }
54
-
55
- /**
56
- * Checks if the items array contains an item with a null value that has a non-null label.
57
- */
58
- function hasNullItemLabel(items) {
59
- if (!Array.isArray(items)) {
60
- return items != null && 'null' in items;
61
- }
62
- const arrayItems = items;
63
- if (isGroupedItems(arrayItems)) {
64
- for (const group of arrayItems) {
65
- for (const item of group.items) {
66
- if (item && item.value == null && item.label != null) {
67
- return true;
68
- }
69
- }
70
- }
71
- return false;
72
- }
73
- for (const item of arrayItems) {
74
- if (item && item.value == null && item.label != null) {
75
- return true;
76
- }
77
- }
78
- return false;
79
- }
80
- function stringifyAsLabel(item, itemToStringLabel) {
81
- if (itemToStringLabel && item != null) {
82
- return itemToStringLabel(item) ?? '';
83
- }
84
- if (item && typeof item === 'object') {
85
- if ('label' in item && item.label != null) {
86
- return String(item.label);
87
- }
88
- if ('value' in item) {
89
- return String(item.value);
90
- }
91
- }
92
- return serializeValue(item);
93
- }
94
- function stringifyAsValue(item, itemToStringValue) {
95
- if (itemToStringValue && item != null) {
96
- return itemToStringValue(item) ?? '';
97
- }
98
- if (item && typeof item === 'object' && 'value' in item && 'label' in item) {
99
- return serializeValue(item.value);
100
- }
101
- return serializeValue(item);
102
- }
103
- function resolveSelectedLabel(value, items, itemToStringLabel) {
104
- function fallback() {
105
- return stringifyAsLabel(value, itemToStringLabel);
106
- }
107
- if (itemToStringLabel && value != null) {
108
- return itemToStringLabel(value);
109
- }
110
-
111
- // Custom object with explicit label takes precedence
112
- if (value && typeof value === 'object' && 'label' in value && value.label != null) {
113
- return value.label;
114
- }
115
-
116
- // Items provided as plain record map
117
- if (items && !Array.isArray(items)) {
118
- return items[value] ?? fallback();
119
- }
120
-
121
- // Items provided as array (flat or grouped)
122
- if (Array.isArray(items)) {
123
- const arrayItems = items;
124
- const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap(group => group.items) : arrayItems;
125
- if (value == null || typeof value !== 'object') {
126
- const match = flatItems.find(item => item.value === value);
127
- if (match && match.label != null) {
128
- return match.label;
129
- }
130
- return fallback();
131
- }
132
-
133
- // Object without explicit label: try matching by its `value` property
134
- if ('value' in value) {
135
- const match = flatItems.find(item => item && item.value === value.value);
136
- if (match && match.label != null) {
137
- return match.label;
138
- }
139
- }
140
- }
141
- return fallback();
142
- }
143
- function resolveMultipleLabels(values, items, itemToStringLabel) {
144
- return values.reduce((acc, value, index) => {
145
- if (index > 0) {
146
- acc.push(', ');
147
- }
148
- acc.push(/*#__PURE__*/jsx(React.Fragment, {
149
- children: resolveSelectedLabel(value, items, itemToStringLabel)
150
- }, index));
151
- return acc;
152
- }, []);
153
- }
154
-
155
- function areArraysEqual(array1, array2, itemComparer = (a, b) => a === b) {
156
- return array1.length === array2.length && array1.every((value, index) => itemComparer(value, array2[index]));
157
- }
158
-
159
- function getDefaultLabelId(id) {
160
- return id == null ? undefined : `${id}-label`;
161
- }
162
- function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
163
- return fieldLabelId ?? localLabelId;
164
- }
165
-
166
- export { stringifyAsLabel as a, areArraysEqual as b, compareItemEquality as c, defaultItemEquality as d, resolveMultipleLabels as e, findItemIndex as f, resolveSelectedLabel as g, hasNullItemLabel as h, selectedValueIncludes as i, removeItem as j, isGroupedItems as k, getDefaultLabelId as l, resolveAriaLabelledBy as r, stringifyAsValue as s };