@parrot-co/parrot-ui 0.1.8 → 0.1.10

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.
package/dist/main.js CHANGED
@@ -71,6 +71,7 @@ $parcel$export(module.exports, "ColorField", () => $ca14d49a10ed918f$export$b865
71
71
  $parcel$export(module.exports, "ColorPicker", () => $b4c448f742efa2a7$export$9feb1bc2e5f1ccb3);
72
72
  $parcel$export(module.exports, "ColorSlider", () => $7796dcb4fe09bf12$export$44fd664bcca5b6fb);
73
73
  $parcel$export(module.exports, "ColorSwatchPicker", () => $799f02b9b0e744b9$export$b46792416e3d8515);
74
+ $parcel$export(module.exports, "parseColor", () => $e93fd810053d36a8$export$6e865ea70d7724f);
74
75
 
75
76
 
76
77
  function $d99c85a751d7ffbd$export$7e4aa119212bc614(value) {
@@ -147,6 +148,211 @@ function $62f1c614c0962470$export$c9058316764c140e(...refs) {
147
148
  }
148
149
  };
149
150
  }
151
+ const $62f1c614c0962470$var$validDOMProperties = new Set([
152
+ // Common HTML attributes
153
+ "accept",
154
+ "acceptCharset",
155
+ "accessKey",
156
+ "action",
157
+ "allowFullScreen",
158
+ "allowTransparency",
159
+ "alt",
160
+ "async",
161
+ "autoComplete",
162
+ "autoFocus",
163
+ "autoPlay",
164
+ "capture",
165
+ "cellPadding",
166
+ "cellSpacing",
167
+ "challenge",
168
+ "charSet",
169
+ "checked",
170
+ "cite",
171
+ "classID",
172
+ "className",
173
+ "colSpan",
174
+ "cols",
175
+ "content",
176
+ "contentEditable",
177
+ "contextMenu",
178
+ "controls",
179
+ "coords",
180
+ "crossOrigin",
181
+ "data",
182
+ "dateTime",
183
+ "default",
184
+ "defer",
185
+ "dir",
186
+ "disabled",
187
+ "download",
188
+ "draggable",
189
+ "encType",
190
+ "form",
191
+ "formAction",
192
+ "formEncType",
193
+ "formMethod",
194
+ "formNoValidate",
195
+ "formTarget",
196
+ "frameBorder",
197
+ "headers",
198
+ "height",
199
+ "hidden",
200
+ "high",
201
+ "href",
202
+ "hrefLang",
203
+ "htmlFor",
204
+ "httpEquiv",
205
+ "icon",
206
+ "id",
207
+ "inputMode",
208
+ "integrity",
209
+ "is",
210
+ "keyParams",
211
+ "keyType",
212
+ "kind",
213
+ "label",
214
+ "lang",
215
+ "list",
216
+ "loop",
217
+ "low",
218
+ "manifest",
219
+ "marginHeight",
220
+ "marginWidth",
221
+ "max",
222
+ "maxLength",
223
+ "media",
224
+ "mediaGroup",
225
+ "method",
226
+ "min",
227
+ "minLength",
228
+ "multiple",
229
+ "muted",
230
+ "name",
231
+ "noValidate",
232
+ "nonce",
233
+ "open",
234
+ "optimum",
235
+ "pattern",
236
+ "placeholder",
237
+ "poster",
238
+ "preload",
239
+ "profile",
240
+ "radioGroup",
241
+ "readOnly",
242
+ "referrerPolicy",
243
+ "rel",
244
+ "required",
245
+ "reversed",
246
+ "role",
247
+ "rowSpan",
248
+ "rows",
249
+ "sandbox",
250
+ "scope",
251
+ "scoped",
252
+ "scrolling",
253
+ "seamless",
254
+ "selected",
255
+ "shape",
256
+ "size",
257
+ "sizes",
258
+ "span",
259
+ "spellCheck",
260
+ "src",
261
+ "srcDoc",
262
+ "srcLang",
263
+ "srcSet",
264
+ "start",
265
+ "step",
266
+ "style",
267
+ "summary",
268
+ "tabIndex",
269
+ "target",
270
+ "title",
271
+ "type",
272
+ "useMap",
273
+ "value",
274
+ "width",
275
+ "wmode",
276
+ "wrap",
277
+ // Event handlers
278
+ "onCopy",
279
+ "onCut",
280
+ "onPaste",
281
+ "onCompositionEnd",
282
+ "onCompositionStart",
283
+ "onCompositionUpdate",
284
+ "onKeyDown",
285
+ "onKeyPress",
286
+ "onKeyUp",
287
+ "onFocus",
288
+ "onBlur",
289
+ "onChange",
290
+ "onInput",
291
+ "onInvalid",
292
+ "onSubmit",
293
+ "onClick",
294
+ "onContextMenu",
295
+ "onDoubleClick",
296
+ "onDrag",
297
+ "onDragEnd",
298
+ "onDragEnter",
299
+ "onDragExit",
300
+ "onDragLeave",
301
+ "onDragOver",
302
+ "onDragStart",
303
+ "onDrop",
304
+ "onMouseDown",
305
+ "onMouseEnter",
306
+ "onMouseLeave",
307
+ "onMouseMove",
308
+ "onMouseOut",
309
+ "onMouseOver",
310
+ "onMouseUp",
311
+ "onSelect",
312
+ "onTouchCancel",
313
+ "onTouchEnd",
314
+ "onTouchMove",
315
+ "onTouchStart",
316
+ "onScroll",
317
+ "onWheel",
318
+ "onAbort",
319
+ "onCanPlay",
320
+ "onCanPlayThrough",
321
+ "onDurationChange",
322
+ "onEmptied",
323
+ "onEncrypted",
324
+ "onEnded",
325
+ "onError",
326
+ "onLoadedData",
327
+ "onLoadedMetadata",
328
+ "onLoadStart",
329
+ "onPause",
330
+ "onPlay",
331
+ "onPlaying",
332
+ "onProgress",
333
+ "onRateChange",
334
+ "onSeeked",
335
+ "onSeeking",
336
+ "onStalled",
337
+ "onSuspend",
338
+ "onTimeUpdate",
339
+ "onVolumeChange",
340
+ "onWaiting",
341
+ "onLoad",
342
+ "onAnimationStart",
343
+ "onAnimationEnd",
344
+ "onAnimationIteration",
345
+ "onTransitionEnd",
346
+ "onToggle"
347
+ ]);
348
+ function $62f1c614c0962470$export$457c3d6518dd4c6f(props) {
349
+ const newProps = {};
350
+ for(const key in props){
351
+ if (!key.startsWith("data-") && !$62f1c614c0962470$var$validDOMProperties.has(key)) continue;
352
+ newProps[key] = props[key];
353
+ }
354
+ return newProps;
355
+ }
150
356
 
151
357
 
152
358
  const $eb8f27c3596a0e6b$export$23c260ee8e4dfaad = ({ stretchX: stretchX, stretchY: stretchY, stretchXY: stretchXY, children: children, className: className, position: position, as: as = "div", ...props }, ref)=>{
@@ -294,7 +500,7 @@ const $c3a954a7c0cb5109$export$21ee1313e2afe36c = (props, ref)=>{
294
500
  className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, inline ? "display-inline-flex" : "display-flex", `flex-direction-${flexDirection}`, wrap && `flex-${wrap}`, justify && `flex-justify-${justify}`, align && `flex-align-${align}`, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("gap", gap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("column-gap", columnGap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("row-gap", rowGap)),
295
501
  // TODO - Fix types here - seems to work just fine though
296
502
  ref: ref,
297
- ...otherProps,
503
+ ...(0, $62f1c614c0962470$export$457c3d6518dd4c6f)(otherProps),
298
504
  children: props.children
299
505
  });
300
506
  };
@@ -558,7 +764,6 @@ function $d9ffc65197682590$export$f5b8910cec6cf069({ className: className, class
558
764
  })
559
765
  });
560
766
  }
561
- $d9ffc65197682590$export$f5b8910cec6cf069.displayName = "Input";
562
767
 
563
768
 
564
769
 
@@ -652,7 +857,7 @@ function $ff6fce0e059b3a1a$export$d2dae087199d2383(object) {
652
857
 
653
858
 
654
859
  const $7f70742e736041ff$var$ButtonGroupContext = /*#__PURE__*/ $8zHUo$react.createContext({});
655
- function $7f70742e736041ff$export$69b1032f2ecdf404({ color: color, variant: variant, size: size, compact: compact, radius: radius, gap: gap, children: children, idleColor: idleColor, activeColor: activeColor, idleVariant: idleVariant, activeVariant: activeVariant, isToggle: isToggle }) {
860
+ function $7f70742e736041ff$export$69b1032f2ecdf404({ color: color, variant: variant, size: size, compact: compact, radius: radius, gap: gap, children: children, idleColor: idleColor, activeColor: activeColor, idleVariant: idleVariant, activeVariant: activeVariant, isToggle: isToggle, className: className, classNames: classNames, style: style, styles: styles }) {
656
861
  const cleanProps = (0, $ff6fce0e059b3a1a$export$d2dae087199d2383)({
657
862
  color: color,
658
863
  variant: variant,
@@ -667,6 +872,10 @@ function $7f70742e736041ff$export$69b1032f2ecdf404({ color: color, variant: vari
667
872
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($7f70742e736041ff$var$ButtonGroupContext.Provider, {
668
873
  value: cleanProps,
669
874
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eae337549f49a5a2$export$eef1e68107c58ef2), {
875
+ className: className,
876
+ classNames: classNames,
877
+ style: style,
878
+ styles: styles,
670
879
  gap: gap,
671
880
  compact: compact,
672
881
  children: children
@@ -719,7 +928,7 @@ const $5a6f28f3fd58ff6e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, ($parcel$int
719
928
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)(Comp, {
720
929
  style: {
721
930
  ...style,
722
- ...styles?.base
931
+ ...styles?.wrapper
723
932
  },
724
933
  "data-is-toggle": isToggle,
725
934
  "data-pressed": isPressed,
@@ -852,10 +1061,10 @@ function $77c71203b3212c65$export$6bf0cd3a219bbade({ appearance: appearance = "o
852
1061
 
853
1062
 
854
1063
 
855
- const $868b95cd1882a2c1$export$b28585a458fee016 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef((props, ref)=>{
1064
+ function $868b95cd1882a2c1$export$b28585a458fee016({ wrapperRef: wrapperRef, ...props }) {
856
1065
  const [showPassword, setShowPassword] = (0, ($parcel$interopDefault($8zHUo$react))).useState(false);
857
1066
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9ffc65197682590$export$f5b8910cec6cf069), {
858
- ref: ref,
1067
+ wrapperRef: wrapperRef,
859
1068
  ...props,
860
1069
  type: showPassword ? "text" : "password",
861
1070
  append: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $3af04cd154cf4de1$export$c25acd513dcc8062), {
@@ -867,8 +1076,7 @@ const $868b95cd1882a2c1$export$b28585a458fee016 = /*#__PURE__*/ (0, ($parcel$int
867
1076
  })
868
1077
  })
869
1078
  });
870
- });
871
- $868b95cd1882a2c1$export$b28585a458fee016.displayName = "PasswordInput";
1079
+ }
872
1080
 
873
1081
 
874
1082
 
@@ -1532,10 +1740,12 @@ function $dcfc4542aa84c062$var$ListOption({ state: state, item: item }) {
1532
1740
  ...optionProps,
1533
1741
  ...otherProps,
1534
1742
  ref: optionRef,
1743
+ "data-text-value": textValue,
1744
+ "data-title": title,
1535
1745
  children: [
1536
1746
  item.rendered,
1537
1747
  isSelected && showSelectionIndicator && (renderSelectionIndicator?.(item) ?? /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
1538
- children: "x"
1748
+ children: "/"
1539
1749
  }))
1540
1750
  ]
1541
1751
  });
@@ -1899,7 +2109,7 @@ $cfadb0728cf907ff$export$3288d34c523a1192.displayName = "Tag";
1899
2109
 
1900
2110
 
1901
2111
 
1902
- function $e37831ebf64d8e7d$export$ef9b1a59e592288f({ label: label, selectionMode: selectionMode = "single", appearance: appearance = "outline", renderValue: renderValue, color: color = "gray", error: error, description: description, size: size = "sm", radius: radius, listBoxColor: listBoxColor, className: className, value: value, defaultValue: defaultValue, onChange: onChange, onSelectionChange: onSelectionChange, style: style, classNames: classNames, styles: styles, showSectionSeparator: showSectionSeparator = true, showSelectionIndicator: showSelectionIndicator = true, ...props }) {
2112
+ function $e37831ebf64d8e7d$export$ef9b1a59e592288f({ label: label, selectionMode: selectionMode = "single", appearance: appearance = "outline", renderValue: renderValue, color: color = "gray", error: error, description: description, size: size = "sm", radius: radius, listBoxColor: listBoxColor, className: className, value: value, onChange: onChange, onSelectionChange: onSelectionChange, style: style, classNames: classNames, styles: styles, showSectionSeparator: showSectionSeparator = true, showSelectionIndicator: showSelectionIndicator = true, ...props }) {
1903
2113
  const isMultiple = selectionMode === "multiple";
1904
2114
  const _value = $8zHUo$react.useMemo(()=>{
1905
2115
  if (!value) return null;
@@ -2150,20 +2360,6 @@ function $9bce4a3d5b18599c$export$b4085f3d3ede4716(array, keys) {
2150
2360
  }
2151
2361
 
2152
2362
 
2153
- const $284d30e280d297d3$var$monthsByIndex = [
2154
- "January",
2155
- "February",
2156
- "March",
2157
- "April",
2158
- "May",
2159
- "June",
2160
- "July",
2161
- "August",
2162
- "Septemper",
2163
- "October",
2164
- "November",
2165
- "December"
2166
- ];
2167
2363
  const $284d30e280d297d3$export$e1aef45b828286de = /*#__PURE__*/ $8zHUo$react.forwardRef(({ numberOfMonths: numberOfMonths = 1, color: color, ...props }, ref)=>{
2168
2364
  const { locale: locale } = (0, $8zHUo$reactaria.useLocale)();
2169
2365
  const state = (0, $8zHUo$reactstately.useCalendarState)({
@@ -2846,7 +3042,7 @@ $c5c6f63b49c9056a$export$b5d5cf8927ab7262.displayName = "Switch";
2846
3042
 
2847
3043
 
2848
3044
 
2849
- function $a945a7e4eb75da9e$export$472062a354075cee({ className: className, classNames: classNames, style: style, styles: styles, name: name, size: size = "sm", orientation: orientation = "horizontal", ...props }) {
3045
+ function $a945a7e4eb75da9e$export$472062a354075cee({ className: className, classNames: classNames, style: style, styles: styles, name: name, size: size = "sm", color: color, orientation: orientation = "horizontal", ...props }) {
2850
3046
  const trackRef = $8zHUo$react.useRef(null);
2851
3047
  const numberFormatter = (0, $8zHUo$reactaria.useNumberFormatter)();
2852
3048
  const state = (0, $8zHUo$reactstately.useSliderState)({
@@ -2859,6 +3055,7 @@ function $a945a7e4eb75da9e$export$472062a354075cee({ className: className, class
2859
3055
  }, state, trackRef);
2860
3056
  const percent = state.getThumbPercent(0);
2861
3057
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
3058
+ "data-color": color,
2862
3059
  "data-size": size,
2863
3060
  style: {
2864
3061
  ...style,
@@ -2873,15 +3070,20 @@ function $a945a7e4eb75da9e$export$472062a354075cee({ className: className, class
2873
3070
  children: props.label
2874
3071
  }),
2875
3072
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
3073
+ ...trackProps,
2876
3074
  ref: trackRef,
2877
3075
  className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-slider-track", classNames?.track),
2878
- ...trackProps,
3076
+ style: {
3077
+ ...styles?.track,
3078
+ ...trackProps.style
3079
+ },
2879
3080
  children: [
2880
3081
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
2881
3082
  style: {
3083
+ ...styles?.fill,
2882
3084
  width: `${percent * 100}%`
2883
3085
  },
2884
- className: "p-slider-track-fill"
3086
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-slider-track-fill", classNames?.fill)
2885
3087
  }),
2886
3088
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($a945a7e4eb75da9e$var$Thumb, {
2887
3089
  styles: {
@@ -2912,14 +3114,15 @@ function $a945a7e4eb75da9e$var$Thumb({ state: state, trackRef: trackRef, index:
2912
3114
  }, state);
2913
3115
  const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $8zHUo$reactaria.useFocusRing)();
2914
3116
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
3117
+ ...thumbProps,
2915
3118
  "data-dragging": isDragging,
2916
3119
  "data-focus-visible": isFocusVisible,
2917
3120
  className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-slider-thumb", className, classNames?.wrapper),
2918
3121
  style: {
3122
+ ...thumbProps.style,
2919
3123
  ...style,
2920
3124
  ...styles?.wrapper
2921
3125
  },
2922
- ...thumbProps,
2923
3126
  children: [
2924
3127
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
2925
3128
  style: styles?.inner,
@@ -3621,7 +3824,7 @@ const $d26053f02b9f370b$export$a79147a60006308c = (0, $8zHUo$reactstately.Item);
3621
3824
 
3622
3825
 
3623
3826
 
3624
- function $b4c448f742efa2a7$export$9feb1bc2e5f1ccb3({ onChange: onChange, color: colorProp }) {
3827
+ function $b4c448f742efa2a7$export$9feb1bc2e5f1ccb3({ onChange: onChange, color: colorProp, styles: styles, classNames: classNames, className: className, style: style }) {
3625
3828
  const [colorSpace, setColorSpace] = $8zHUo$react.useState("hex");
3626
3829
  const [color, setColor] = (0, $c410efc80bcce413$export$40bfa8c7b0832715)(colorProp, (0, $8zHUo$reactstatelycolor.parseColor)("#BB66CC").toFormat("hsla"), onChange);
3627
3830
  function handleChange(color) {