@react-spectrum/color 3.0.0-nightly.4567 → 3.0.0-nightly.4578

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 (96) hide show
  1. package/dist/ColorArea.main.js +11 -10
  2. package/dist/ColorArea.main.js.map +1 -1
  3. package/dist/ColorArea.mjs +12 -11
  4. package/dist/ColorArea.module.js +12 -11
  5. package/dist/ColorArea.module.js.map +1 -1
  6. package/dist/ColorEditor.32e497e8.css +20 -0
  7. package/dist/ColorEditor.32e497e8.css.map +1 -0
  8. package/dist/ColorEditor.main.js +116 -0
  9. package/dist/ColorEditor.main.js.map +1 -0
  10. package/dist/ColorEditor.mjs +111 -0
  11. package/dist/ColorEditor.module.js +111 -0
  12. package/dist/ColorEditor.module.js.map +1 -0
  13. package/dist/ColorField.main.js +44 -6
  14. package/dist/ColorField.main.js.map +1 -1
  15. package/dist/ColorField.mjs +46 -8
  16. package/dist/ColorField.module.js +46 -8
  17. package/dist/ColorField.module.js.map +1 -1
  18. package/dist/ColorPicker.ab9f47c0.css +204 -0
  19. package/dist/ColorPicker.ab9f47c0.css.map +1 -0
  20. package/dist/ColorPicker.main.js +125 -0
  21. package/dist/ColorPicker.main.js.map +1 -0
  22. package/dist/ColorPicker.mjs +116 -0
  23. package/dist/ColorPicker.module.js +116 -0
  24. package/dist/ColorPicker.module.js.map +1 -0
  25. package/dist/ColorSlider.main.js +8 -4
  26. package/dist/ColorSlider.main.js.map +1 -1
  27. package/dist/ColorSlider.mjs +9 -5
  28. package/dist/ColorSlider.module.js +9 -5
  29. package/dist/ColorSlider.module.js.map +1 -1
  30. package/dist/ColorSwatch.f6e6f811.css +260 -0
  31. package/dist/ColorSwatch.f6e6f811.css.map +1 -0
  32. package/dist/ColorSwatch.main.js +94 -0
  33. package/dist/ColorSwatch.main.js.map +1 -0
  34. package/dist/ColorSwatch.mjs +84 -0
  35. package/dist/ColorSwatch.module.js +84 -0
  36. package/dist/ColorSwatch.module.js.map +1 -0
  37. package/dist/ColorSwatchPicker.1575be06.css +356 -0
  38. package/dist/ColorSwatchPicker.1575be06.css.map +1 -0
  39. package/dist/ColorSwatchPicker.main.js +115 -0
  40. package/dist/ColorSwatchPicker.main.js.map +1 -0
  41. package/dist/ColorSwatchPicker.mjs +106 -0
  42. package/dist/ColorSwatchPicker.module.js +106 -0
  43. package/dist/ColorSwatchPicker.module.js.map +1 -0
  44. package/dist/ColorThumb.main.js +57 -7
  45. package/dist/ColorThumb.main.js.map +1 -1
  46. package/dist/ColorThumb.mjs +59 -9
  47. package/dist/ColorThumb.module.js +59 -9
  48. package/dist/ColorThumb.module.js.map +1 -1
  49. package/dist/ColorWheel.main.js +6 -2
  50. package/dist/ColorWheel.main.js.map +1 -1
  51. package/dist/ColorWheel.mjs +7 -3
  52. package/dist/ColorWheel.module.js +7 -3
  53. package/dist/ColorWheel.module.js.map +1 -1
  54. package/dist/colorarea_vars_css.main.js +0 -3
  55. package/dist/colorarea_vars_css.main.js.map +1 -1
  56. package/dist/colorarea_vars_css.mjs +0 -3
  57. package/dist/colorarea_vars_css.module.js +0 -3
  58. package/dist/colorarea_vars_css.module.js.map +1 -1
  59. package/dist/en-US.main.js +10 -0
  60. package/dist/en-US.main.js.map +1 -0
  61. package/dist/en-US.mjs +12 -0
  62. package/dist/en-US.module.js +12 -0
  63. package/dist/en-US.module.js.map +1 -0
  64. package/dist/import.mjs +11 -1
  65. package/dist/intlStrings.main.js +9 -0
  66. package/dist/intlStrings.main.js.map +1 -0
  67. package/dist/intlStrings.mjs +11 -0
  68. package/dist/intlStrings.module.js +11 -0
  69. package/dist/intlStrings.module.js.map +1 -0
  70. package/dist/main.js +16 -0
  71. package/dist/main.js.map +1 -1
  72. package/dist/module.js +11 -1
  73. package/dist/module.js.map +1 -1
  74. package/dist/types.d.ts +75 -4
  75. package/dist/types.d.ts.map +1 -1
  76. package/dist/{vars.08ba4b4c.css → vars.53b417c1.css} +2 -3
  77. package/dist/vars.53b417c1.css.map +1 -0
  78. package/dist/{vars.6f3d3943.css → vars.6fa9fa04.css} +6 -18
  79. package/dist/vars.6fa9fa04.css.map +1 -0
  80. package/dist/{vars.571f903e.css → vars.aa07b6d2.css} +2 -2
  81. package/dist/{vars.571f903e.css.map → vars.aa07b6d2.css.map} +1 -1
  82. package/dist/{vars.ef2c01b8.css → vars.cc682729.css} +4 -4
  83. package/dist/{vars.ef2c01b8.css.map → vars.cc682729.css.map} +1 -1
  84. package/package.json +23 -17
  85. package/src/ColorArea.tsx +7 -6
  86. package/src/ColorEditor.tsx +63 -0
  87. package/src/ColorField.tsx +67 -14
  88. package/src/ColorPicker.tsx +122 -0
  89. package/src/ColorSlider.tsx +6 -4
  90. package/src/ColorSwatch.tsx +102 -0
  91. package/src/ColorSwatchPicker.tsx +118 -0
  92. package/src/ColorThumb.tsx +72 -25
  93. package/src/ColorWheel.tsx +5 -2
  94. package/src/index.ts +10 -0
  95. package/dist/vars.08ba4b4c.css.map +0 -1
  96. package/dist/vars.6f3d3943.css.map +0 -1
@@ -1,11 +1,13 @@
1
1
  require("./colorfield.faeff3c2.css");
2
2
  var $ddec4d6aa21146c4$exports = require("./colorfield_css.main.js");
3
3
  var $4ivT8$reactspectrumutils = require("@react-spectrum/utils");
4
+ var $4ivT8$reactariacomponents = require("react-aria-components");
4
5
  var $4ivT8$react = require("react");
5
6
  var $4ivT8$reactspectrumtextfield = require("@react-spectrum/textfield");
6
7
  var $4ivT8$reactariacolor = require("@react-aria/color");
7
8
  var $4ivT8$reactstatelycolor = require("@react-stately/color");
8
9
  var $4ivT8$reactspectrumform = require("@react-spectrum/form");
10
+ var $4ivT8$reactariai18n = require("@react-aria/i18n");
9
11
  var $4ivT8$reactspectrumprovider = require("@react-spectrum/provider");
10
12
 
11
13
 
@@ -36,26 +38,62 @@ $parcel$export(module.exports, "ColorField", () => $8bdb9bc27ff3debb$export$b865
36
38
 
37
39
 
38
40
 
41
+
42
+
39
43
  function $8bdb9bc27ff3debb$var$ColorField(props, ref) {
40
44
  props = (0, $4ivT8$reactspectrumprovider.useProviderProps)(props);
41
45
  props = (0, $4ivT8$reactspectrumform.useFormProps)(props);
46
+ [props] = (0, $4ivT8$reactariacomponents.useContextProps)(props, null, (0, $4ivT8$reactariacomponents.ColorFieldContext));
47
+ if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text");
48
+ if (props.channel) return /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement($8bdb9bc27ff3debb$var$ColorChannelField, {
49
+ ...props,
50
+ channel: props.channel,
51
+ forwardedRef: ref
52
+ });
53
+ else return /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement($8bdb9bc27ff3debb$var$HexColorField, {
54
+ ...props,
55
+ forwardedRef: ref
56
+ });
57
+ }
58
+ /**
59
+ * A color field allows users to edit a hex color or individual color channel value.
60
+ */ const $8bdb9bc27ff3debb$export$b865d4358897bb17 = /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).forwardRef($8bdb9bc27ff3debb$var$ColorField);
61
+ function $8bdb9bc27ff3debb$var$ColorChannelField(props) {
42
62
  let { value: // These disabled props are handled by the state hook
43
- value, defaultValue: defaultValue, onChange: onChange, ...otherProps } = props;
63
+ value, defaultValue: defaultValue, onChange: onChange, validate: validate, forwardedRef: forwardedRef, ...otherProps } = props;
64
+ let { locale: locale } = (0, $4ivT8$reactariai18n.useLocale)();
65
+ let state = (0, $4ivT8$reactstatelycolor.useColorChannelFieldState)({
66
+ ...props,
67
+ locale: locale
68
+ });
69
+ let inputRef = (0, $4ivT8$react.useRef)(null);
70
+ let result = (0, $4ivT8$reactariacolor.useColorChannelField)(otherProps, state, inputRef);
71
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement((0, ($parcel$interopDefault($4ivT8$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement((0, $4ivT8$reactspectrumtextfield.TextFieldBase), {
72
+ ...otherProps,
73
+ ref: forwardedRef,
74
+ inputRef: inputRef,
75
+ ...result,
76
+ inputClassName: (0, $4ivT8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($ddec4d6aa21146c4$exports))), "react-spectrum-ColorField-input")
77
+ }), props.name && /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement("input", {
78
+ type: "hidden",
79
+ name: props.name,
80
+ value: isNaN(state.numberValue) ? "" : state.numberValue
81
+ }));
82
+ }
83
+ function $8bdb9bc27ff3debb$var$HexColorField(props) {
84
+ let { value: // These disabled props are handled by the state hook
85
+ value, defaultValue: defaultValue, onChange: onChange, forwardedRef: forwardedRef, ...otherProps } = props;
44
86
  let state = (0, $4ivT8$reactstatelycolor.useColorFieldState)(props);
45
87
  let inputRef = (0, $4ivT8$react.useRef)(null);
46
88
  let result = (0, $4ivT8$reactariacolor.useColorField)(otherProps, state, inputRef);
47
- if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text");
48
89
  return /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).createElement((0, $4ivT8$reactspectrumtextfield.TextFieldBase), {
49
90
  ...otherProps,
50
- ref: ref,
91
+ ref: forwardedRef,
51
92
  inputRef: inputRef,
52
93
  ...result,
53
94
  inputClassName: (0, $4ivT8$reactspectrumutils.classNames)((0, ($parcel$interopDefault($ddec4d6aa21146c4$exports))), "react-spectrum-ColorField-input")
54
95
  });
55
96
  }
56
- /**
57
- * ColorFields allow users to enter a color in #rrggbb hexadecimal format.
58
- */ const $8bdb9bc27ff3debb$export$b865d4358897bb17 = /*#__PURE__*/ (0, ($parcel$interopDefault($4ivT8$react))).forwardRef($8bdb9bc27ff3debb$var$ColorField);
59
97
 
60
98
 
61
99
  //# sourceMappingURL=ColorField.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAaD,SAAS,iCAAW,KAA8B,EAAE,GAAsB;IACxE,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,SACF,qDAAqD;IACrD,KAAK,gBACL,YAAY,YACZ,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,QAAQ,CAAA,GAAA,2CAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,mCAAY,EAAE,YAAY,OAAO;IAE9C,IAAI,MAAM,WAAW,EACnB,QAAQ,IAAI,CAAC;IAGf,qBACE,0DAAC,CAAA,GAAA,2CAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAEzC;AAEA;;CAEC,GACD,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/color/src/ColorField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport React, {Ref, useRef} from 'react';\nimport {SpectrumColorFieldProps} from '@react-types/color';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useColorField} from '@react-aria/color';\nimport {useColorFieldState} from '@react-stately/color';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction ColorField(props: SpectrumColorFieldProps, ref: Ref<TextFieldRef>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n if (props.placeholder) {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text');\n }\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={ref}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')} />\n );\n}\n\n/**\n * ColorFields allow users to enter a color in #rrggbb hexadecimal format.\n */\nconst _ColorField = React.forwardRef(ColorField);\nexport {_ColorField as ColorField};\n"],"names":[],"version":3,"file":"ColorField.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAeD,SAAS,iCAAW,KAA8B,EAAE,GAAsB;IACxE,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,0CAAc,EAAE,OAAO,MAAM,CAAA,GAAA,4CAAgB;IACvD,IAAI,MAAM,WAAW,EACnB,QAAQ,IAAI,CAAC;IAGf,IAAI,MAAM,OAAO,EACf,qBAAO,0DAAC;QAAmB,GAAG,KAAK;QAAE,SAAS,MAAM,OAAO;QAAE,cAAc;;SAE3E,qBAAO,0DAAC;QAAe,GAAG,KAAK;QAAE,cAAc;;AAEnD;AAEA;;CAEC,GACD,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;AAQrC,SAAS,wCAAkB,KAA6B;IACtD,IAAI,SACF,qDAAqD;IACrD,KAAK,gBACL,YAAY,YACZ,QAAQ,YACR,QAAQ,gBACR,YAAY,EACZ,GAAG,YACJ,GAAG;IACJ,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,kDAAwB,EAAE;QACpC,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,0CAAmB,EAAE,YAAY,OAAO;IAErD,qBACE,oIACE,0DAAC,CAAA,GAAA,2CAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACpC,MAAM,IAAI,kBAAI,0DAAC;QAAM,MAAK;QAAS,MAAM,MAAM,IAAI;QAAE,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAGpH;AAMA,SAAS,oCAAc,KAAyB;IAC9C,IAAI,SACF,qDAAqD;IACrD,KAAK,gBACL,YAAY,YACZ,QAAQ,gBACR,YAAY,EACZ,GAAG,YACJ,GAAG;IACJ,IAAI,QAAQ,CAAA,GAAA,2CAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,mCAAY,EAAE,YAAY,OAAO;IAE9C,qBACE,0DAAC,CAAA,GAAA,2CAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAEzC","sources":["packages/@react-spectrum/color/src/ColorField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {ColorChannel, SpectrumColorFieldProps} from '@react-types/color';\nimport {ColorFieldContext, useContextProps} from 'react-aria-components';\nimport React, {Ref, useRef} from 'react';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useColorChannelField, useColorField} from '@react-aria/color';\nimport {useColorChannelFieldState, useColorFieldState} from '@react-stately/color';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction ColorField(props: SpectrumColorFieldProps, ref: Ref<TextFieldRef>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n if (props.placeholder) {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text');\n }\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nconst _ColorField = React.forwardRef(ColorField);\nexport {_ColorField as ColorField};\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel,\n forwardedRef: Ref<TextFieldRef>\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')} />\n {props.name && <input type=\"hidden\" name={props.name} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')} />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.main.js.map"}
@@ -1,11 +1,13 @@
1
1
  import "./colorfield.faeff3c2.css";
2
2
  import $b4uus$colorfield_cssmodulejs from "./colorfield_css.mjs";
3
3
  import {classNames as $b4uus$classNames} from "@react-spectrum/utils";
4
+ import {useContextProps as $b4uus$useContextProps, ColorFieldContext as $b4uus$ColorFieldContext} from "react-aria-components";
4
5
  import $b4uus$react, {useRef as $b4uus$useRef} from "react";
5
6
  import {TextFieldBase as $b4uus$TextFieldBase} from "@react-spectrum/textfield";
6
- import {useColorField as $b4uus$useColorField} from "@react-aria/color";
7
- import {useColorFieldState as $b4uus$useColorFieldState} from "@react-stately/color";
7
+ import {useColorChannelField as $b4uus$useColorChannelField, useColorField as $b4uus$useColorField} from "@react-aria/color";
8
+ import {useColorChannelFieldState as $b4uus$useColorChannelFieldState, useColorFieldState as $b4uus$useColorFieldState} from "@react-stately/color";
8
9
  import {useFormProps as $b4uus$useFormProps} from "@react-spectrum/form";
10
+ import {useLocale as $b4uus$useLocale} from "@react-aria/i18n";
9
11
  import {useProviderProps as $b4uus$useProviderProps} from "@react-spectrum/provider";
10
12
 
11
13
 
@@ -30,26 +32,62 @@ function $parcel$interopDefault(a) {
30
32
 
31
33
 
32
34
 
35
+
36
+
33
37
  function $0077d47e004328f0$var$ColorField(props, ref) {
34
38
  props = (0, $b4uus$useProviderProps)(props);
35
39
  props = (0, $b4uus$useFormProps)(props);
40
+ [props] = (0, $b4uus$useContextProps)(props, null, (0, $b4uus$ColorFieldContext));
41
+ if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text");
42
+ if (props.channel) return /*#__PURE__*/ (0, $b4uus$react).createElement($0077d47e004328f0$var$ColorChannelField, {
43
+ ...props,
44
+ channel: props.channel,
45
+ forwardedRef: ref
46
+ });
47
+ else return /*#__PURE__*/ (0, $b4uus$react).createElement($0077d47e004328f0$var$HexColorField, {
48
+ ...props,
49
+ forwardedRef: ref
50
+ });
51
+ }
52
+ /**
53
+ * A color field allows users to edit a hex color or individual color channel value.
54
+ */ const $0077d47e004328f0$export$b865d4358897bb17 = /*#__PURE__*/ (0, $b4uus$react).forwardRef($0077d47e004328f0$var$ColorField);
55
+ function $0077d47e004328f0$var$ColorChannelField(props) {
36
56
  let { value: // These disabled props are handled by the state hook
37
- value, defaultValue: defaultValue, onChange: onChange, ...otherProps } = props;
57
+ value, defaultValue: defaultValue, onChange: onChange, validate: validate, forwardedRef: forwardedRef, ...otherProps } = props;
58
+ let { locale: locale } = (0, $b4uus$useLocale)();
59
+ let state = (0, $b4uus$useColorChannelFieldState)({
60
+ ...props,
61
+ locale: locale
62
+ });
63
+ let inputRef = (0, $b4uus$useRef)(null);
64
+ let result = (0, $b4uus$useColorChannelField)(otherProps, state, inputRef);
65
+ return /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$react).Fragment, null, /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$TextFieldBase), {
66
+ ...otherProps,
67
+ ref: forwardedRef,
68
+ inputRef: inputRef,
69
+ ...result,
70
+ inputClassName: (0, $b4uus$classNames)((0, ($parcel$interopDefault($b4uus$colorfield_cssmodulejs))), "react-spectrum-ColorField-input")
71
+ }), props.name && /*#__PURE__*/ (0, $b4uus$react).createElement("input", {
72
+ type: "hidden",
73
+ name: props.name,
74
+ value: isNaN(state.numberValue) ? "" : state.numberValue
75
+ }));
76
+ }
77
+ function $0077d47e004328f0$var$HexColorField(props) {
78
+ let { value: // These disabled props are handled by the state hook
79
+ value, defaultValue: defaultValue, onChange: onChange, forwardedRef: forwardedRef, ...otherProps } = props;
38
80
  let state = (0, $b4uus$useColorFieldState)(props);
39
81
  let inputRef = (0, $b4uus$useRef)(null);
40
82
  let result = (0, $b4uus$useColorField)(otherProps, state, inputRef);
41
- if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text");
42
83
  return /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$TextFieldBase), {
43
84
  ...otherProps,
44
- ref: ref,
85
+ ref: forwardedRef,
45
86
  inputRef: inputRef,
46
87
  ...result,
47
88
  inputClassName: (0, $b4uus$classNames)((0, ($parcel$interopDefault($b4uus$colorfield_cssmodulejs))), "react-spectrum-ColorField-input")
48
89
  });
49
90
  }
50
- /**
51
- * ColorFields allow users to enter a color in #rrggbb hexadecimal format.
52
- */ const $0077d47e004328f0$export$b865d4358897bb17 = /*#__PURE__*/ (0, $b4uus$react).forwardRef($0077d47e004328f0$var$ColorField);
53
91
 
54
92
 
55
93
  export {$0077d47e004328f0$export$b865d4358897bb17 as ColorField};
@@ -1,11 +1,13 @@
1
1
  import "./colorfield.faeff3c2.css";
2
2
  import $b4uus$colorfield_cssmodulejs from "./colorfield_css.module.js";
3
3
  import {classNames as $b4uus$classNames} from "@react-spectrum/utils";
4
+ import {useContextProps as $b4uus$useContextProps, ColorFieldContext as $b4uus$ColorFieldContext} from "react-aria-components";
4
5
  import $b4uus$react, {useRef as $b4uus$useRef} from "react";
5
6
  import {TextFieldBase as $b4uus$TextFieldBase} from "@react-spectrum/textfield";
6
- import {useColorField as $b4uus$useColorField} from "@react-aria/color";
7
- import {useColorFieldState as $b4uus$useColorFieldState} from "@react-stately/color";
7
+ import {useColorChannelField as $b4uus$useColorChannelField, useColorField as $b4uus$useColorField} from "@react-aria/color";
8
+ import {useColorChannelFieldState as $b4uus$useColorChannelFieldState, useColorFieldState as $b4uus$useColorFieldState} from "@react-stately/color";
8
9
  import {useFormProps as $b4uus$useFormProps} from "@react-spectrum/form";
10
+ import {useLocale as $b4uus$useLocale} from "@react-aria/i18n";
9
11
  import {useProviderProps as $b4uus$useProviderProps} from "@react-spectrum/provider";
10
12
 
11
13
 
@@ -30,26 +32,62 @@ function $parcel$interopDefault(a) {
30
32
 
31
33
 
32
34
 
35
+
36
+
33
37
  function $0077d47e004328f0$var$ColorField(props, ref) {
34
38
  props = (0, $b4uus$useProviderProps)(props);
35
39
  props = (0, $b4uus$useFormProps)(props);
40
+ [props] = (0, $b4uus$useContextProps)(props, null, (0, $b4uus$ColorFieldContext));
41
+ if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text");
42
+ if (props.channel) return /*#__PURE__*/ (0, $b4uus$react).createElement($0077d47e004328f0$var$ColorChannelField, {
43
+ ...props,
44
+ channel: props.channel,
45
+ forwardedRef: ref
46
+ });
47
+ else return /*#__PURE__*/ (0, $b4uus$react).createElement($0077d47e004328f0$var$HexColorField, {
48
+ ...props,
49
+ forwardedRef: ref
50
+ });
51
+ }
52
+ /**
53
+ * A color field allows users to edit a hex color or individual color channel value.
54
+ */ const $0077d47e004328f0$export$b865d4358897bb17 = /*#__PURE__*/ (0, $b4uus$react).forwardRef($0077d47e004328f0$var$ColorField);
55
+ function $0077d47e004328f0$var$ColorChannelField(props) {
36
56
  let { value: // These disabled props are handled by the state hook
37
- value, defaultValue: defaultValue, onChange: onChange, ...otherProps } = props;
57
+ value, defaultValue: defaultValue, onChange: onChange, validate: validate, forwardedRef: forwardedRef, ...otherProps } = props;
58
+ let { locale: locale } = (0, $b4uus$useLocale)();
59
+ let state = (0, $b4uus$useColorChannelFieldState)({
60
+ ...props,
61
+ locale: locale
62
+ });
63
+ let inputRef = (0, $b4uus$useRef)(null);
64
+ let result = (0, $b4uus$useColorChannelField)(otherProps, state, inputRef);
65
+ return /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$react).Fragment, null, /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$TextFieldBase), {
66
+ ...otherProps,
67
+ ref: forwardedRef,
68
+ inputRef: inputRef,
69
+ ...result,
70
+ inputClassName: (0, $b4uus$classNames)((0, ($parcel$interopDefault($b4uus$colorfield_cssmodulejs))), "react-spectrum-ColorField-input")
71
+ }), props.name && /*#__PURE__*/ (0, $b4uus$react).createElement("input", {
72
+ type: "hidden",
73
+ name: props.name,
74
+ value: isNaN(state.numberValue) ? "" : state.numberValue
75
+ }));
76
+ }
77
+ function $0077d47e004328f0$var$HexColorField(props) {
78
+ let { value: // These disabled props are handled by the state hook
79
+ value, defaultValue: defaultValue, onChange: onChange, forwardedRef: forwardedRef, ...otherProps } = props;
38
80
  let state = (0, $b4uus$useColorFieldState)(props);
39
81
  let inputRef = (0, $b4uus$useRef)(null);
40
82
  let result = (0, $b4uus$useColorField)(otherProps, state, inputRef);
41
- if (props.placeholder) console.warn("Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text");
42
83
  return /*#__PURE__*/ (0, $b4uus$react).createElement((0, $b4uus$TextFieldBase), {
43
84
  ...otherProps,
44
- ref: ref,
85
+ ref: forwardedRef,
45
86
  inputRef: inputRef,
46
87
  ...result,
47
88
  inputClassName: (0, $b4uus$classNames)((0, ($parcel$interopDefault($b4uus$colorfield_cssmodulejs))), "react-spectrum-ColorField-input")
48
89
  });
49
90
  }
50
- /**
51
- * ColorFields allow users to enter a color in #rrggbb hexadecimal format.
52
- */ const $0077d47e004328f0$export$b865d4358897bb17 = /*#__PURE__*/ (0, $b4uus$react).forwardRef($0077d47e004328f0$var$ColorField);
53
91
 
54
92
 
55
93
  export {$0077d47e004328f0$export$b865d4358897bb17 as ColorField};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAaD,SAAS,iCAAW,KAA8B,EAAE,GAAsB;IACxE,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,SACF,qDAAqD;IACrD,KAAK,gBACL,YAAY,YACZ,QAAQ,EACR,GAAG,YACJ,GAAG;IACJ,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,aAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,oBAAY,EAAE,YAAY,OAAO;IAE9C,IAAI,MAAM,WAAW,EACnB,QAAQ,IAAI,CAAC;IAGf,qBACE,gCAAC,CAAA,GAAA,oBAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;;AAEzC;AAEA;;CAEC,GACD,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/color/src/ColorField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport React, {Ref, useRef} from 'react';\nimport {SpectrumColorFieldProps} from '@react-types/color';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useColorField} from '@react-aria/color';\nimport {useColorFieldState} from '@react-stately/color';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction ColorField(props: SpectrumColorFieldProps, ref: Ref<TextFieldRef>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n if (props.placeholder) {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text');\n }\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={ref}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')} />\n );\n}\n\n/**\n * ColorFields allow users to enter a color in #rrggbb hexadecimal format.\n */\nconst _ColorField = React.forwardRef(ColorField);\nexport {_ColorField as ColorField};\n"],"names":[],"version":3,"file":"ColorField.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAeD,SAAS,iCAAW,KAA8B,EAAE,GAAsB;IACxE,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,CAAC,MAAM,GAAG,CAAA,GAAA,sBAAc,EAAE,OAAO,MAAM,CAAA,GAAA,wBAAgB;IACvD,IAAI,MAAM,WAAW,EACnB,QAAQ,IAAI,CAAC;IAGf,IAAI,MAAM,OAAO,EACf,qBAAO,gCAAC;QAAmB,GAAG,KAAK;QAAE,SAAS,MAAM,OAAO;QAAE,cAAc;;SAE3E,qBAAO,gCAAC;QAAe,GAAG,KAAK;QAAE,cAAc;;AAEnD;AAEA;;CAEC,GACD,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;AAQrC,SAAS,wCAAkB,KAA6B;IACtD,IAAI,SACF,qDAAqD;IACrD,KAAK,gBACL,YAAY,YACZ,QAAQ,YACR,QAAQ,gBACR,YAAY,EACZ,GAAG,YACJ,GAAG;IACJ,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,gCAAwB,EAAE;QACpC,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,2BAAmB,EAAE,YAAY,OAAO;IAErD,qBACE,gFACE,gCAAC,CAAA,GAAA,oBAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;QACpC,MAAM,IAAI,kBAAI,gCAAC;QAAM,MAAK;QAAS,MAAM,MAAM,IAAI;QAAE,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAGpH;AAMA,SAAS,oCAAc,KAAyB;IAC9C,IAAI,SACF,qDAAqD;IACrD,KAAK,gBACL,YAAY,YACZ,QAAQ,gBACR,YAAY,EACZ,GAAG,YACJ,GAAG;IACJ,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;IAC/B,IAAI,WAAW,CAAA,GAAA,aAAK,EAA0C;IAC9D,IAAI,SAAS,CAAA,GAAA,oBAAY,EAAE,YAAY,OAAO;IAE9C,qBACE,gCAAC,CAAA,GAAA,oBAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,UAAU;QACT,GAAG,MAAM;QACV,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;;AAEzC","sources":["packages/@react-spectrum/color/src/ColorField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {ColorChannel, SpectrumColorFieldProps} from '@react-types/color';\nimport {ColorFieldContext, useContextProps} from 'react-aria-components';\nimport React, {Ref, useRef} from 'react';\nimport styles from './colorfield.css';\nimport {TextFieldBase} from '@react-spectrum/textfield';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useColorChannelField, useColorField} from '@react-aria/color';\nimport {useColorChannelFieldState, useColorFieldState} from '@react-stately/color';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction ColorField(props: SpectrumColorFieldProps, ref: Ref<TextFieldRef>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n [props] = useContextProps(props, null, ColorFieldContext);\n if (props.placeholder) {\n console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/ColorField.html#help-text');\n }\n\n if (props.channel) {\n return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;\n } else {\n return <HexColorField {...props} forwardedRef={ref} />;\n }\n}\n\n/**\n * A color field allows users to edit a hex color or individual color channel value.\n */\nconst _ColorField = React.forwardRef(ColorField);\nexport {_ColorField as ColorField};\n\ninterface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {\n channel: ColorChannel,\n forwardedRef: Ref<TextFieldRef>\n}\n\nfunction ColorChannelField(props: ColorChannelFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n validate, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let {locale} = useLocale();\n let state = useColorChannelFieldState({\n ...props,\n locale\n });\n\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorChannelField(otherProps, state, inputRef);\n\n return (\n <>\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')} />\n {props.name && <input type=\"hidden\" name={props.name} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </>\n );\n}\n\ninterface HexColorFieldProps extends SpectrumColorFieldProps {\n forwardedRef: Ref<TextFieldRef>\n}\n\nfunction HexColorField(props: HexColorFieldProps) {\n let {\n // These disabled props are handled by the state hook\n value, // eslint-disable-line @typescript-eslint/no-unused-vars\n defaultValue, // eslint-disable-line @typescript-eslint/no-unused-vars\n onChange, // eslint-disable-line @typescript-eslint/no-unused-vars\n forwardedRef,\n ...otherProps\n } = props;\n let state = useColorFieldState(props);\n let inputRef = useRef<HTMLInputElement & HTMLTextAreaElement>(null);\n let result = useColorField(otherProps, state, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={forwardedRef}\n inputRef={inputRef}\n {...result}\n inputClassName={classNames(styles, 'react-spectrum-ColorField-input')} />\n );\n}\n"],"names":[],"version":3,"file":"ColorField.module.js.map"}
@@ -0,0 +1,204 @@
1
+ @layer a {
2
+ .ba {
3
+ background-color: #0000;
4
+ }
5
+
6
+ .Af {
7
+ border-style: none;
8
+ }
9
+
10
+ .Ia {
11
+ padding-top: 0;
12
+ }
13
+
14
+ .Ja {
15
+ padding-bottom: 0;
16
+ }
17
+
18
+ .Ga {
19
+ padding-inline-start: 0;
20
+ }
21
+
22
+ .Ha {
23
+ padding-inline-end: 0;
24
+ }
25
+
26
+ ._Sd {
27
+ display: flex;
28
+ }
29
+
30
+ ._Uc {
31
+ align-items: center;
32
+ }
33
+
34
+ .lM {
35
+ row-gap: .714286em;
36
+ }
37
+
38
+ .mM {
39
+ column-gap: .714286em;
40
+ }
41
+
42
+ ._5a {
43
+ font-family: adobe-clean, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
44
+ }
45
+
46
+ .a___K {
47
+ color: var(--spectrum-alias-text-color, var(--spectrum-global-color-gray-800));
48
+ }
49
+
50
+ ._6a {
51
+ font-size: var(--spectrum-global-dimension-font-size-50);
52
+ }
53
+
54
+ ._6b {
55
+ font-size: var(--spectrum-global-dimension-font-size-75);
56
+ }
57
+
58
+ ._6c {
59
+ font-size: var(--spectrum-global-dimension-font-size-100);
60
+ }
61
+
62
+ ._6d {
63
+ font-size: var(--spectrum-global-dimension-font-size-200);
64
+ }
65
+
66
+ ._Ea {
67
+ outline-style: none;
68
+ }
69
+
70
+ ._Eb {
71
+ outline-style: solid;
72
+ }
73
+
74
+ .d___I {
75
+ outline-color: var(--spectrum-alias-focus-color, var(--spectrum-global-color-blue-400));
76
+ }
77
+
78
+ ._Gc {
79
+ outline-width: var(--spectrum-alias-border-size-thick, var(--spectrum-global-dimension-static-size-25));
80
+ }
81
+
82
+ ._Fc {
83
+ outline-offset: var(--spectrum-alias-border-size-thick, var(--spectrum-global-dimension-static-size-25));
84
+ }
85
+
86
+ ._pc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
87
+ border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
88
+ }
89
+
90
+ ._pc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
91
+ border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
92
+ }
93
+
94
+ ._pc:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
95
+ border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
96
+ }
97
+
98
+ ._pc:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
99
+ border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
100
+ }
101
+
102
+ ._qc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
103
+ border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
104
+ }
105
+
106
+ ._qc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
107
+ border-top-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
108
+ }
109
+
110
+ ._qc:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
111
+ border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
112
+ }
113
+
114
+ ._qc:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
115
+ border-top-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
116
+ }
117
+
118
+ ._rc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
119
+ border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
120
+ }
121
+
122
+ ._rc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
123
+ border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
124
+ }
125
+
126
+ ._rc:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
127
+ border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
128
+ }
129
+
130
+ ._rc:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
131
+ border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
132
+ }
133
+
134
+ ._sc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
135
+ border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
136
+ }
137
+
138
+ ._sc:not(:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi))) {
139
+ border-bottom-right-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
140
+ }
141
+
142
+ ._sc:-webkit-any(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
143
+ border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
144
+ }
145
+
146
+ ._sc:is(:lang(ae), :lang(ar), :lang(arc), :lang(bcc), :lang(bqi), :lang(ckb), :lang(dv), :lang(fa), :lang(glk), :lang(he), :lang(ku), :lang(mzn), :lang(nqo), :lang(pnb), :lang(ps), :lang(sd), :lang(ug), :lang(ur), :lang(yi)) {
147
+ border-bottom-left-radius: var(--spectrum-alias-border-radius-regular, var(--spectrum-global-dimension-size-50));
148
+ }
149
+ }
150
+
151
+ @layer b {
152
+ ._5-enzrfpb:lang(ar) {
153
+ font-family: myriad-arabic, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
154
+ }
155
+ }
156
+
157
+ @layer c {
158
+ ._5-enzwzjc:lang(he) {
159
+ font-family: myriad-hebrew, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
160
+ }
161
+ }
162
+
163
+ @layer d {
164
+ ._5-enzykdd:lang(ja) {
165
+ font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
166
+ }
167
+ }
168
+
169
+ @layer e {
170
+ ._5-enzzrge:lang(ko) {
171
+ font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
172
+ }
173
+ }
174
+
175
+ @layer f {
176
+ ._5-eo0c6sf:lang(zh) {
177
+ font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
178
+ }
179
+ }
180
+
181
+ @layer g {
182
+ ._5-1uotwbwg:lang(zh-hant) {
183
+ font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
184
+ }
185
+ }
186
+
187
+ @layer h {
188
+ ._5-bc1l9oh:-webkit-any(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
189
+ font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
190
+ }
191
+
192
+ ._5-bc1l9oh:is(:lang(zh-Hans), :lang(zh-CN), :lang(zh-SG)) {
193
+ font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
194
+ }
195
+ }
196
+
197
+ @layer b.a {
198
+ @media (forced-colors: active) {
199
+ .da___D {
200
+ outline-color: highlight;
201
+ }
202
+ }
203
+ }
204
+ /*# sourceMappingURL=ColorPicker.ab9f47c0.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"ACAA;EAGE;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAYA;;;;EA8DA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAMA;;;;EAxJA;;;;EAMA;;;;EAMA;;;;EAcA;;;;EAMA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA3DF;EA4EI;;;;;AA5EJ;EAoFI;;;;;AApFJ;EA4FI;;;;;AA5FJ;EAoGI;;;;;AApGJ;EA4GI;;;;;AA5GJ;EAoHI;;;;;AApHJ;EA4HI;;;;EAAA;;;;;AAxGJ;EACE;IACE","sources":["4265cbe66e3f0344","packages/@react-spectrum/color/src/ColorPicker.tsx"],"sourcesContent":["@import \"01eac0e6ccf8a0b9\";\n@import \"e3400cf9c7231dbc\";\n","@layer a, b, c, d, e, f, g, h;\n\n@layer a {\n .ba {\n background-color: transparent;\n }\n}\n\n@layer a {\n .Af {\n border-style: none;\n }\n}\n\n@layer a {\n .Ia {\n padding-top: 0px;\n }\n}\n\n@layer a {\n .Ja {\n padding-bottom: 0px;\n }\n}\n\n@layer a {\n .Ga {\n padding-inline-start: 0px;\n }\n}\n\n@layer a {\n .Ha {\n padding-inline-end: 0px;\n }\n}\n\n@layer a {\n ._Sd {\n display: flex;\n }\n}\n\n@layer a {\n ._Uc {\n align-items: center;\n }\n}\n\n@layer a {\n .lM {\n row-gap: 0.7142857142857143em;\n }\n}\n\n@layer a {\n .mM {\n column-gap: 0.7142857142857143em;\n }\n}\n\n@layer a {\n ._Ea {\n outline-style: none;\n }\n}\n\n@layer a {\n ._5a {\n font-family: adobe-clean, ui-sans-serif, system-ui, sans-serif;\n }\n}\n\n@layer b {\n ._5-enzrfpb {\n &:lang(ar) {\n font-family: myriad-arabic, ui-sans-serif, system-ui, sans-serif;\n }\n }\n}\n\n@layer c {\n ._5-enzwzjc {\n &:lang(he) {\n font-family: myriad-hebrew, ui-sans-serif, system-ui, sans-serif;\n }\n }\n}\n\n@layer d {\n ._5-enzykdd {\n &:lang(ja) {\n font-family: adobe-clean-han-japanese, 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Osaka, YuGothic, 'Yu Gothic', 'メイリオ', Meiryo, 'MS Pゴシック', 'MS PGothic', sans-serif;\n }\n }\n}\n\n@layer e {\n ._5-enzzrge {\n &:lang(ko) {\n font-family: adobe-clean-han-korean, source-han-korean, 'Malgun Gothic', 'Apple Gothic', sans-serif;\n }\n }\n}\n\n@layer f {\n ._5-eo0c6sf {\n &:lang(zh) {\n font-family: adobe-clean-han-traditional, source-han-traditional, 'MingLiu', 'Heiti TC Light', sans-serif;\n }\n }\n}\n\n@layer g {\n ._5-1uotwbwg {\n &:lang(zh-hant) {\n font-family: adobe-clean-han-traditional, source-han-traditional, 'MingLiu', 'Microsoft JhengHei UI', 'Microsoft JhengHei', 'Heiti TC Light', sans-serif;\n }\n }\n}\n\n@layer h {\n ._5-bc1l9oh {\n &:lang(zh-Hans, zh-CN, zh-SG) {\n font-family: adobe-clean-han-simplified-c, source-han-simplified-c, 'SimSun', 'Heiti SC Light', sans-serif;\n }\n }\n}\n\n@layer a {\n .a___K {\n color: var(--spectrum-alias-text-color, var(--spectrum-global-color-gray-800));\n }\n}\n\n@layer a {\n ._6a {\n font-size: var(--spectrum-global-dimension-font-size-50);\n }\n}\n\n@layer a {\n ._6b {\n font-size: var(--spectrum-global-dimension-font-size-75);\n }\n}\n\n@layer a {\n ._6c {\n font-size: var(--spectrum-global-dimension-font-size-100);\n }\n}\n\n@layer a {\n ._6d {\n font-size: var(--spectrum-global-dimension-font-size-200);\n }\n}\n\n"],"names":[],"version":3,"file":"ColorPicker.ab9f47c0.css.map"}
@@ -0,0 +1,125 @@
1
+ require("./ColorPicker.ab9f47c0.css");
2
+ var $f076f5c85640192a$exports = require("./ColorSwatch.main.js");
3
+ var $64NP6$reactariacomponents = require("react-aria-components");
4
+ var $64NP6$reactspectrumview = require("@react-spectrum/view");
5
+ var $64NP6$reactspectrumdialog = require("@react-spectrum/dialog");
6
+ var $64NP6$react = require("react");
7
+ var $64NP6$reactspectrumutils = require("@react-spectrum/utils");
8
+ var $64NP6$reactariautils = require("@react-aria/utils");
9
+
10
+
11
+ function $parcel$interopDefault(a) {
12
+ return a && a.__esModule ? a.default : a;
13
+ }
14
+
15
+ function $parcel$export(e, n, v, s) {
16
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
17
+ }
18
+
19
+ $parcel$export(module.exports, "ColorPicker", () => $0c330b4a4fe337a6$export$9feb1bc2e5f1ccb3);
20
+ /*
21
+ * Copyright 2024 Adobe. All rights reserved.
22
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
23
+ * you may not use this file except in compliance with the License. You may obtain a copy
24
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
25
+ *
26
+ * Unless required by applicable law or agreed to in writing, software distributed under
27
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
28
+ * OF ANY KIND, either express or implied. See the License for the specific language
29
+ * governing permissions and limitations under the License.
30
+ */
31
+
32
+
33
+
34
+
35
+
36
+
37
+ function $0c330b4a4fe337a6$var$ColorPicker(props, ref) {
38
+ let swatchRef = (0, $64NP6$react.useRef)(null);
39
+ let domRef = (0, $64NP6$reactspectrumutils.useFocusableRef)(ref);
40
+ let labelId = (0, $64NP6$reactariautils.useId)();
41
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactariacomponents.ColorPicker), props, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactspectrumdialog.DialogTrigger), {
42
+ type: "popover",
43
+ mobileType: "tray",
44
+ targetRef: (0, $64NP6$reactspectrumutils.unwrapDOMRef)(swatchRef)
45
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactariacomponents.Button), {
46
+ ref: domRef,
47
+ className: function anonymous(props) {
48
+ let rules = "";
49
+ rules += " ba";
50
+ rules += " Af";
51
+ rules += " Ia";
52
+ rules += " Ja";
53
+ rules += " Ga";
54
+ rules += " Ha";
55
+ rules += " _Sd";
56
+ rules += " _Uc";
57
+ rules += " lM";
58
+ rules += " mM";
59
+ rules += " _Ea";
60
+ rules += " _5-bc1l9oh";
61
+ rules += " _5-1uotwbwg";
62
+ rules += " _5-eo0c6sf";
63
+ rules += " _5-enzzrge";
64
+ rules += " _5-enzykdd";
65
+ rules += " _5-enzwzjc";
66
+ rules += " _5-enzrfpb";
67
+ rules += " _5a";
68
+ rules += " a___K";
69
+ if (props.size === "L") rules += " _6d";
70
+ else if (props.size === "M") rules += " _6c";
71
+ else if (props.size === "S") rules += " _6b";
72
+ else if (props.size === "XS") rules += " _6a";
73
+ return rules;
74
+ }({
75
+ size: props.size || "M"
76
+ })
77
+ }, ({ isFocusVisible: isFocusVisible })=>/*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, ($parcel$interopDefault($64NP6$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement("div", {
78
+ className: function anonymous(props) {
79
+ let rules = "";
80
+ if (props.isFocusVisible) rules += " _Eb";
81
+ else rules += " _Ea";
82
+ rules += " da___D";
83
+ rules += " d___I";
84
+ rules += " _Gc";
85
+ rules += " _Fc";
86
+ rules += " _pc";
87
+ rules += " _qc";
88
+ rules += " _rc";
89
+ rules += " _sc";
90
+ return rules;
91
+ }({
92
+ isFocusVisible: isFocusVisible
93
+ })
94
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $f076f5c85640192a$exports.ColorSwatch), {
95
+ ref: swatchRef,
96
+ size: props.size,
97
+ rounding: props.rounding,
98
+ "aria-label": props["aria-label"],
99
+ "aria-labelledby": props["aria-labelledby"],
100
+ "aria-describedby": props["aria-describedby"],
101
+ "aria-details": props["aria-details"]
102
+ })), props.label && /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement("span", {
103
+ id: labelId
104
+ }, props.label))), /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactspectrumdialog.Dialog), {
105
+ "aria-labelledby": props.label ? labelId : props["aria-labelledby"],
106
+ "aria-label": props["aria-label"],
107
+ UNSAFE_style: {
108
+ width: "fit-content",
109
+ minWidth: 0,
110
+ margin: "0 auto" // Center within tray.
111
+ }
112
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).createElement((0, $64NP6$reactspectrumview.Content), {
113
+ UNSAFE_style: {
114
+ position: "relative",
115
+ margin: "calc(var(--spectrum-dialog-padding) * -1)",
116
+ padding: "var(--spectrum-global-dimension-size-200)"
117
+ }
118
+ }, props.children))));
119
+ }
120
+ /**
121
+ * A ColorPicker combines a swatch with a customizable popover for editing a color.
122
+ */ let $0c330b4a4fe337a6$export$9feb1bc2e5f1ccb3 = /*#__PURE__*/ (0, ($parcel$interopDefault($64NP6$react))).forwardRef($0c330b4a4fe337a6$var$ColorPicker);
123
+
124
+
125
+ //# sourceMappingURL=ColorPicker.main.js.map