@parrot-co/parrot-ui 0.1.10 → 0.1.12

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/module.js CHANGED
@@ -675,10 +675,11 @@ function $095d89378519ff08$export$a455218a85c89869({ label: label, description:
675
675
  $095d89378519ff08$export$a455218a85c89869.displayName = "Field";
676
676
 
677
677
 
678
- function $ef10b8551376ecd8$export$f5b8910cec6cf069({ className: className, classNames: classNames, style: style, styles: styles, inputRef: inputRef, ...props }) {
678
+ function $ef10b8551376ecd8$export$f5b8910cec6cf069({ className: className, classNames: classNames, style: style, styles: styles, onChange: onChange, inputRef: inputRef, ...props }) {
679
679
  const internalInputRef = (0, $hgUW1$react).useRef(null);
680
680
  const { labelProps: labelProps, inputProps: inputProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps } = (0, $hgUW1$useTextField)({
681
681
  ...props,
682
+ onChange: onChange,
682
683
  inputElementType: "input"
683
684
  }, internalInputRef);
684
685
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
@@ -691,7 +692,7 @@ function $ef10b8551376ecd8$export$f5b8910cec6cf069({ className: className, class
691
692
  style: style,
692
693
  ...props,
693
694
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
694
- ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(internalInputRef, inputRef),
695
+ ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(inputRef, internalInputRef),
695
696
  "data-has-left-addon": !!props.prepend,
696
697
  "data-has-right-addon": !!props.append,
697
698
  className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-text-input-el"),
@@ -922,12 +923,13 @@ $e3f71af5eaf1c216$export$c25acd513dcc8062.displayName = "IconButton";
922
923
 
923
924
 
924
925
 
925
- function $2e89c7375b40283e$export$6bf0cd3a219bbade({ appearance: appearance = "outline", size: size = "md", color: color = "gray", classNames: classNames, styles: styles, append: append, prepend: prepend, placeholder: placeholder, showSteppers: showSteppers = false, error: error, label: label, minValue: minValue, maxValue: maxValue, formatOptions: formatOptions, inputRef: inputRef, incrementIcon: incrementIcon, decrementIcon: decrementIcon, ...props }) {
926
+ function $2e89c7375b40283e$export$6bf0cd3a219bbade({ appearance: appearance = "outline", size: size = "md", color: color = "gray", classNames: classNames, styles: styles, append: append, prepend: prepend, placeholder: placeholder, showSteppers: showSteppers = false, error: error, label: label, minValue: minValue, maxValue: maxValue, formatOptions: formatOptions, inputRef: inputRef, incrementIcon: incrementIcon, decrementIcon: decrementIcon, onChange: onChange, ...props }) {
926
927
  const ariaProps = {
927
928
  ...props,
928
929
  maxValue: maxValue,
929
930
  formatOptions: formatOptions,
930
931
  minValue: minValue,
932
+ onChange: onChange,
931
933
  "aria-label": props["aria-label"] ?? "number input"
932
934
  };
933
935
  const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
@@ -4256,5 +4258,176 @@ function $8f49d2e6ba434739$export$6e865ea70d7724f(color) {
4256
4258
 
4257
4259
 
4258
4260
 
4259
- export {$ee0105641360f1c1$export$e71c4d32a2263218 as Box, $11bc53f9891a6532$export$ef2184bd89960b14 as Grid, $11bc53f9891a6532$export$9eb849b9b922d396 as GridItem, $e2f278d76a00796a$export$f51f4c4ede09e011 as Flex, $ef10b8551376ecd8$export$f5b8910cec6cf069 as Input, $2e89c7375b40283e$export$6bf0cd3a219bbade as NumberInput, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6 as Text, $7794de767effca39$export$379139ebc1c2b235 as Textarea, $d95a2216d3ccf702$export$353f5b6fc5456de1 as Button, $e3f71af5eaf1c216$export$c25acd513dcc8062 as IconButton, $9230e224c5c26d9c$export$69b1032f2ecdf404 as ButtonGroup, $0ca204e719955216$export$48513f6b9f8ce62d as Checkbox, $1ab2e355b7aa4310$export$4aa08d5625cb8ead as CheckboxGroup, $3ba60d401cc6cc09$export$e44a253a59704894 as DropdownMenu, $618e53c42107439d$export$72b9695b8216309a as ComboBox, $e00a258f2e8c7774$export$d7b12c4107be0d61 as Radio, $e00a258f2e8c7774$export$a98f0dcb43a68a25 as RadioGroup, $e3711da06539818f$export$f8afaea2e9656b91 as RadioCard, $9f79d30a629e2c71$export$ef9b1a59e592288f as Select, $c35269c9504bc94d$export$5b7f4051a57920d0 as Option, $c35269c9504bc94d$export$5b7f4051a57920d0 as ListBoxItem, $c35269c9504bc94d$export$ef146090a6472d9e as Section, $c35269c9504bc94d$export$ef146090a6472d9e as ListBoxSection, $48aceaf3289ec325$export$7edc06cf1783b30f as DateInput, $11e1beb2a56c81ba$export$e1aef45b828286de as Calendar, $55bcc0e5986993c4$export$e2255cf6045e8d47 as Avatar, $f9f5a5b674d0a63f$export$1a5cb5295a7d2749 as FileUploader, $1a0bc09c6bea5bcc$export$1ff3c3f08ae963c0 as Separator, $2cc726bf01dd2fe8$export$b25a304ec7d746bb as Progress, $e1148cdb3a130657$export$3b0d6d7590275603 as Loader, $c700d45659d35204$export$3288d34c523a1192 as Tag, $fac55dfefd316398$export$b5d5cf8927ab7262 as Switch, $17f80f062b7f107f$export$472062a354075cee as Slider, $62ecff109eaa29fb$export$50e381fea3a45244 as IconTray, $6bbafdf52af7a191$export$ea98c603db73aee7 as Sticker, $28ce03a907630a4d$export$b2539bed5023c21c as Tabs, $28ce03a907630a4d$export$6d08773d2e66f8f2 as Tab, $18afd8c09c9f3065$export$54ec01a60f47d33d as Table, $727b3a4d9b39464f$export$e6a97ba2cae5bb94 as Timeline, $4bad2c10a2b6e638$export$2b77a92f1a5ad772 as Modal, $4bad2c10a2b6e638$export$33ffd74ebf07f060 as useModal, $41cc567ab0625f8f$export$eef1e68107c58ef2 as Space, $aca304249f917497$export$39299b56cfd4e361 as TagInput, $61ac9d13c14b7f5b$export$5b6b19405a83ff9d as Popover, $61ac9d13c14b7f5b$export$d7e1f420b25549ff as PopoverContent, $61ac9d13c14b7f5b$export$7dacb05d26466c3 as PopoverTrigger, $31aad62a65b342bc$export$67ea30858aaf75e3 as TagGroup, $31aad62a65b342bc$export$a79147a60006308c as TagGroupItem, $5fc28f26e128d5c0$export$d8964aec282183a3 as ThemeProvider, $5fc28f26e128d5c0$export$93d4e7f90805808f as useTheme, $d03055b0909e9e3a$export$b2103f68a961418e as ColorArea, $2abac2409e7cef4a$export$b865d4358897bb17 as ColorField, $b925f0cf89a3187d$export$9feb1bc2e5f1ccb3 as ColorPicker, $216a62c521cf5bbd$export$44fd664bcca5b6fb as ColorSlider, $a364ffae99b57fd7$export$b46792416e3d8515 as ColorSwatchPicker, $8f49d2e6ba434739$export$6e865ea70d7724f as parseColor};
4261
+
4262
+
4263
+
4264
+
4265
+
4266
+
4267
+ const $aae8cd5f0e2ea26c$var$ToggleGroupContext = /*#__PURE__*/ $hgUW1$createContext(null);
4268
+ function $aae8cd5f0e2ea26c$export$af3ec21f6cfb5e30({ children: children, mode: mode = "single", value: value, defaultValue: defaultValue, onChange: onChange, validate: validate, styles: styles, classNames: classNames, className: className, style: style, ...props }) {
4269
+ const Wrapper = $hgUW1$useMemo(()=>{
4270
+ if (mode === "single") return $aae8cd5f0e2ea26c$var$SingleSelectGroup;
4271
+ return $aae8cd5f0e2ea26c$var$MultiSelectGroup;
4272
+ }, [
4273
+ mode
4274
+ ]);
4275
+ props = {
4276
+ ...props
4277
+ };
4278
+ return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
4279
+ label: props.label,
4280
+ replaceDefaultControlWrapper: true,
4281
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)(Wrapper, {
4282
+ value: value,
4283
+ defaultValue: defaultValue,
4284
+ onChange: onChange,
4285
+ validate: validate,
4286
+ ...props,
4287
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)((0, $41cc567ab0625f8f$export$eef1e68107c58ef2), {
4288
+ className: className,
4289
+ styles: styles,
4290
+ classNames: classNames,
4291
+ style: style,
4292
+ ...props,
4293
+ children: children
4294
+ })
4295
+ })
4296
+ });
4297
+ }
4298
+ function $aae8cd5f0e2ea26c$var$SingleSelectGroup({ children: children, orientation: orientation = "horizontal", ...props }) {
4299
+ const state = (0, $hgUW1$useRadioGroupState)(props);
4300
+ const { radioGroupProps: radioGroupProps } = (0, $hgUW1$useRadioGroup)({
4301
+ ...props,
4302
+ orientation: orientation,
4303
+ "aria-label": "single toggle group"
4304
+ }, state);
4305
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4306
+ ...radioGroupProps,
4307
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)($aae8cd5f0e2ea26c$var$ToggleGroupContext.Provider, {
4308
+ value: {
4309
+ state: state,
4310
+ mode: "single",
4311
+ props: props
4312
+ },
4313
+ children: children
4314
+ })
4315
+ });
4316
+ }
4317
+ function $aae8cd5f0e2ea26c$var$MultiSelectGroup({ children: children, ...props }) {
4318
+ const state = (0, $hgUW1$useCheckboxGroupState)(props);
4319
+ const { groupProps: groupProps } = (0, $hgUW1$useCheckboxGroup)({
4320
+ ...props,
4321
+ "aria-label": "multiple toggle group"
4322
+ }, state);
4323
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
4324
+ ...groupProps,
4325
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)($aae8cd5f0e2ea26c$var$ToggleGroupContext.Provider, {
4326
+ value: {
4327
+ state: state,
4328
+ mode: "multiple",
4329
+ props: props
4330
+ },
4331
+ children: children
4332
+ })
4333
+ });
4334
+ }
4335
+ function $aae8cd5f0e2ea26c$var$SingleToggle({ ...props }) {
4336
+ const ctx = $hgUW1$useContext($aae8cd5f0e2ea26c$var$ToggleGroupContext);
4337
+ const state = ctx?.state;
4338
+ const ref = $hgUW1$useRef(null);
4339
+ if (!ctx) throw new Error("Toggle must be used within a ToggleGroup");
4340
+ const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $hgUW1$useFocusRing)();
4341
+ const isSelected = state.selectedValue === props.value;
4342
+ const { inputProps: inputProps } = (0, $hgUW1$useRadio)(props, ctx.state, ref);
4343
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)($aae8cd5f0e2ea26c$var$ToggleButton, {
4344
+ isSelected: isSelected,
4345
+ isFocusVisible: isFocusVisible,
4346
+ children: [
4347
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$VisuallyHidden), {
4348
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
4349
+ ref: ref,
4350
+ ...(0, $hgUW1$mergeProps)(inputProps, focusProps)
4351
+ })
4352
+ }),
4353
+ props.children
4354
+ ]
4355
+ });
4356
+ }
4357
+ function $aae8cd5f0e2ea26c$var$MultiToggle({ ...props }) {
4358
+ const ctx = $hgUW1$useContext($aae8cd5f0e2ea26c$var$ToggleGroupContext);
4359
+ const state = ctx?.state;
4360
+ const ref = $hgUW1$useRef(null);
4361
+ if (!ctx) throw new Error("Toggle must be used within a ToggleGroup");
4362
+ const { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $hgUW1$useFocusRing)();
4363
+ const isSelected = state.isSelected(props.value);
4364
+ const { inputProps: inputProps } = (0, $hgUW1$useCheckboxGroupItem)(props, ctx.state, ref);
4365
+ return /*#__PURE__*/ (0, $hgUW1$jsxs)($aae8cd5f0e2ea26c$var$ToggleButton, {
4366
+ isSelected: isSelected,
4367
+ isFocusVisible: isFocusVisible,
4368
+ children: [
4369
+ /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$VisuallyHidden), {
4370
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
4371
+ ref: ref,
4372
+ ...(0, $hgUW1$mergeProps)(inputProps, focusProps)
4373
+ })
4374
+ }),
4375
+ props.children
4376
+ ]
4377
+ });
4378
+ }
4379
+ const $aae8cd5f0e2ea26c$var$ToggleContext = /*#__PURE__*/ $hgUW1$createContext(null);
4380
+ function $aae8cd5f0e2ea26c$export$bea8ebba691c5813({ ...props }) {
4381
+ const ctx = $hgUW1$useContext($aae8cd5f0e2ea26c$var$ToggleGroupContext);
4382
+ if (!ctx) throw new Error("Toggle must be used within a ToggleGroup");
4383
+ const Wrapper = $hgUW1$useMemo(()=>{
4384
+ if (ctx?.mode === "single") return $aae8cd5f0e2ea26c$var$SingleToggle;
4385
+ return $aae8cd5f0e2ea26c$var$MultiToggle;
4386
+ }, [
4387
+ ctx?.mode
4388
+ ]);
4389
+ return /*#__PURE__*/ (0, $hgUW1$jsx)($aae8cd5f0e2ea26c$var$ToggleContext.Provider, {
4390
+ value: {
4391
+ props: props
4392
+ },
4393
+ children: /*#__PURE__*/ (0, $hgUW1$jsx)(Wrapper, {
4394
+ value: props.value,
4395
+ children: props.children
4396
+ })
4397
+ });
4398
+ }
4399
+ function $aae8cd5f0e2ea26c$var$ToggleButton({ children: children, isFocusVisible: isFocusVisible, isSelected: isSelected, ...props }) {
4400
+ const ctx = $hgUW1$useContext($aae8cd5f0e2ea26c$var$ToggleContext)?.props;
4401
+ const groupCtx = $hgUW1$useContext($aae8cd5f0e2ea26c$var$ToggleGroupContext);
4402
+ if (!ctx || !groupCtx) throw new Error("Toggle must be used within a ToggleGroup");
4403
+ const theme = (0, $5fc28f26e128d5c0$export$93d4e7f90805808f)();
4404
+ const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
4405
+ const idleColor = ctx.idleColor ?? groupCtx.props.idleColor ?? "gray";
4406
+ const activeColor = ctx.activeColor ?? groupCtx.props.activeColor ?? theme?.color ?? "gray";
4407
+ const idleVariant = ctx.idleVariant ?? groupCtx.props.idleVariant ?? "light";
4408
+ const activeVariant = ctx.activeVariant ?? groupCtx.props.activeVariant ?? "solid";
4409
+ const color = isSelected ? activeColor : idleColor;
4410
+ const variant = isSelected ? activeVariant : idleVariant;
4411
+ const radius = ctx.radius ?? groupCtx.props.radius ?? "full";
4412
+ const size = ctx.size ?? groupCtx.props.size ?? "md";
4413
+ return /*#__PURE__*/ (0, $hgUW1$jsx)("label", {
4414
+ "data-icon-button": ctx.isIconButton,
4415
+ "data-is-toggle": true,
4416
+ "data-radius": radius,
4417
+ "data-color": color,
4418
+ "data-variant": variant,
4419
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-button", ctx.className, ctx.classNames?.wrapper, `size-${size}`, space.classNames),
4420
+ "data-selected": isSelected,
4421
+ "data-focus-visible": isFocusVisible,
4422
+ ...props,
4423
+ children: children
4424
+ });
4425
+ }
4426
+
4427
+
4428
+
4429
+
4430
+
4431
+
4432
+ export {$ee0105641360f1c1$export$e71c4d32a2263218 as Box, $11bc53f9891a6532$export$ef2184bd89960b14 as Grid, $11bc53f9891a6532$export$9eb849b9b922d396 as GridItem, $e2f278d76a00796a$export$f51f4c4ede09e011 as Flex, $ef10b8551376ecd8$export$f5b8910cec6cf069 as Input, $2e89c7375b40283e$export$6bf0cd3a219bbade as NumberInput, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6 as Text, $7794de767effca39$export$379139ebc1c2b235 as Textarea, $d95a2216d3ccf702$export$353f5b6fc5456de1 as Button, $e3f71af5eaf1c216$export$c25acd513dcc8062 as IconButton, $9230e224c5c26d9c$export$69b1032f2ecdf404 as ButtonGroup, $0ca204e719955216$export$48513f6b9f8ce62d as Checkbox, $1ab2e355b7aa4310$export$4aa08d5625cb8ead as CheckboxGroup, $3ba60d401cc6cc09$export$e44a253a59704894 as DropdownMenu, $618e53c42107439d$export$72b9695b8216309a as ComboBox, $e00a258f2e8c7774$export$d7b12c4107be0d61 as Radio, $e00a258f2e8c7774$export$a98f0dcb43a68a25 as RadioGroup, $e3711da06539818f$export$f8afaea2e9656b91 as RadioCard, $9f79d30a629e2c71$export$ef9b1a59e592288f as Select, $c35269c9504bc94d$export$5b7f4051a57920d0 as Option, $c35269c9504bc94d$export$5b7f4051a57920d0 as ListBoxItem, $c35269c9504bc94d$export$ef146090a6472d9e as Section, $c35269c9504bc94d$export$ef146090a6472d9e as ListBoxSection, $48aceaf3289ec325$export$7edc06cf1783b30f as DateInput, $11e1beb2a56c81ba$export$e1aef45b828286de as Calendar, $55bcc0e5986993c4$export$e2255cf6045e8d47 as Avatar, $f9f5a5b674d0a63f$export$1a5cb5295a7d2749 as FileUploader, $1a0bc09c6bea5bcc$export$1ff3c3f08ae963c0 as Separator, $2cc726bf01dd2fe8$export$b25a304ec7d746bb as Progress, $e1148cdb3a130657$export$3b0d6d7590275603 as Loader, $c700d45659d35204$export$3288d34c523a1192 as Tag, $fac55dfefd316398$export$b5d5cf8927ab7262 as Switch, $17f80f062b7f107f$export$472062a354075cee as Slider, $62ecff109eaa29fb$export$50e381fea3a45244 as IconTray, $6bbafdf52af7a191$export$ea98c603db73aee7 as Sticker, $28ce03a907630a4d$export$b2539bed5023c21c as Tabs, $28ce03a907630a4d$export$6d08773d2e66f8f2 as Tab, $18afd8c09c9f3065$export$54ec01a60f47d33d as Table, $727b3a4d9b39464f$export$e6a97ba2cae5bb94 as Timeline, $4bad2c10a2b6e638$export$2b77a92f1a5ad772 as Modal, $4bad2c10a2b6e638$export$33ffd74ebf07f060 as useModal, $41cc567ab0625f8f$export$eef1e68107c58ef2 as Space, $aca304249f917497$export$39299b56cfd4e361 as TagInput, $61ac9d13c14b7f5b$export$5b6b19405a83ff9d as Popover, $61ac9d13c14b7f5b$export$d7e1f420b25549ff as PopoverContent, $61ac9d13c14b7f5b$export$7dacb05d26466c3 as PopoverTrigger, $31aad62a65b342bc$export$67ea30858aaf75e3 as TagGroup, $31aad62a65b342bc$export$a79147a60006308c as TagGroupItem, $5fc28f26e128d5c0$export$d8964aec282183a3 as ThemeProvider, $5fc28f26e128d5c0$export$93d4e7f90805808f as useTheme, $d03055b0909e9e3a$export$b2103f68a961418e as ColorArea, $2abac2409e7cef4a$export$b865d4358897bb17 as ColorField, $b925f0cf89a3187d$export$9feb1bc2e5f1ccb3 as ColorPicker, $216a62c521cf5bbd$export$44fd664bcca5b6fb as ColorSlider, $a364ffae99b57fd7$export$b46792416e3d8515 as ColorSwatchPicker, $8f49d2e6ba434739$export$6e865ea70d7724f as parseColor, $aae8cd5f0e2ea26c$export$bea8ebba691c5813 as Toggle, $aae8cd5f0e2ea26c$export$af3ec21f6cfb5e30 as ToggleGroup};
4260
4433
  //# sourceMappingURL=module.js.map