@artsy/palette 35.0.0 → 36.0.0-canary.1250.28474.0

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 (62) hide show
  1. package/dist/elements/AutocompleteInput/AutocompleteInput.d.ts +3 -1
  2. package/dist/elements/AutocompleteInput/AutocompleteInput.js +3 -2
  3. package/dist/elements/AutocompleteInput/AutocompleteInput.js.map +1 -1
  4. package/dist/elements/AutocompleteInput/AutocompleteInput.story.d.ts +1 -0
  5. package/dist/elements/AutocompleteInput/AutocompleteInput.story.js +25 -1
  6. package/dist/elements/AutocompleteInput/AutocompleteInput.story.js.map +1 -1
  7. package/dist/elements/BorderedRadio/BorderedRadio.d.ts +20 -20
  8. package/dist/elements/Input/Input.d.ts +3 -0
  9. package/dist/elements/Input/Input.js +59 -15
  10. package/dist/elements/Input/Input.js.map +1 -1
  11. package/dist/elements/Input/Input.story.js +14 -0
  12. package/dist/elements/Input/Input.story.js.map +1 -1
  13. package/dist/elements/Input/tokens.js +7 -6
  14. package/dist/elements/Input/tokens.js.map +1 -1
  15. package/dist/elements/Input/types.d.ts +1 -1
  16. package/dist/elements/Input/types.js.map +1 -1
  17. package/dist/elements/Label/Label.js +2 -2
  18. package/dist/elements/Label/Label.js.map +1 -1
  19. package/dist/elements/LabeledInput/LabeledInput.d.ts +2 -1
  20. package/dist/elements/LabeledInput/LabeledInput.js +12 -10
  21. package/dist/elements/LabeledInput/LabeledInput.js.map +1 -1
  22. package/dist/elements/LabeledInput/LabeledInput.story.js +12 -0
  23. package/dist/elements/LabeledInput/LabeledInput.story.js.map +1 -1
  24. package/dist/elements/PhoneInput/PhoneInput.d.ts +33 -0
  25. package/dist/elements/PhoneInput/PhoneInput.js +319 -0
  26. package/dist/elements/PhoneInput/PhoneInput.js.map +1 -0
  27. package/dist/elements/PhoneInput/PhoneInput.story.d.ts +5 -0
  28. package/dist/elements/PhoneInput/PhoneInput.story.js +207 -0
  29. package/dist/elements/PhoneInput/PhoneInput.story.js.map +1 -0
  30. package/dist/elements/PhoneInput/index.d.ts +1 -0
  31. package/dist/elements/PhoneInput/index.js +17 -0
  32. package/dist/elements/PhoneInput/index.js.map +1 -0
  33. package/dist/elements/PhoneInput/tokens.d.ts +9 -0
  34. package/dist/elements/PhoneInput/tokens.js +19 -0
  35. package/dist/elements/PhoneInput/tokens.js.map +1 -0
  36. package/dist/elements/Select/Select.d.ts +0 -2
  37. package/dist/elements/Select/Select.js +25 -28
  38. package/dist/elements/Select/Select.js.map +1 -1
  39. package/dist/elements/Select/Select.story.d.ts +0 -1
  40. package/dist/elements/Select/Select.story.js +16 -34
  41. package/dist/elements/Select/Select.story.js.map +1 -1
  42. package/dist/elements/Select/tokens.d.ts +2 -7
  43. package/dist/elements/Select/tokens.js +6 -5
  44. package/dist/elements/Select/tokens.js.map +1 -1
  45. package/dist/elements/Select/types.d.ts +1 -2
  46. package/dist/elements/Select/types.js.map +1 -1
  47. package/dist/elements/TextArea/TextArea.d.ts +1 -1
  48. package/dist/elements/TextArea/TextArea.js +34 -26
  49. package/dist/elements/TextArea/TextArea.js.map +1 -1
  50. package/dist/elements/TextArea/tokens.js +7 -6
  51. package/dist/elements/TextArea/tokens.js.map +1 -1
  52. package/dist/elements/TextArea/types.d.ts +1 -1
  53. package/dist/elements/TextArea/types.js.map +1 -1
  54. package/dist/elements/index.d.ts +1 -0
  55. package/dist/elements/index.js +11 -0
  56. package/dist/elements/index.js.map +1 -1
  57. package/dist/shared/RequiredField.d.ts +3 -0
  58. package/dist/shared/RequiredField.js +20 -0
  59. package/dist/shared/RequiredField.js.map +1 -0
  60. package/dist/themes/Themes.story.js +0 -38
  61. package/dist/themes/Themes.story.js.map +1 -1
  62. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhoneInput.story.js","names":["_react","_interopRequireDefault","require","_storybookStates","_PhoneInput","obj","__esModule","default","_default","title","exports","countriesExample","text","name","value","countryCode","flag","Default","createElement","States","states","placeholder","required","disabled","error","PhoneInput","options","onSelect","option","console","log","displayName"],"sources":["../../../src/elements/PhoneInput/PhoneInput.story.tsx"],"sourcesContent":["import React from \"react\"\nimport { States } from \"storybook-states\"\nimport { PhoneInput, PhoneInputProps } from \"./PhoneInput\"\n\nexport default {\n title: \"Components/PhoneInput\",\n}\n\nconst countriesExample = [\n {\n text: \"🇦🇫 +93\",\n name: \"Afghanistan\",\n value: \"af\",\n countryCode: \"+93\",\n flag: \"🇦🇫\",\n },\n {\n text: \"🇦🇽 +358\",\n name: \"Aland Islands\",\n value: \"ax\",\n countryCode: \"+358\",\n flag: \"🇦🇽\",\n },\n {\n text: \"🇦🇱 +355\",\n name: \"Albania\",\n value: \"al\",\n countryCode: \"+355\",\n flag: \"🇦🇱\",\n },\n {\n text: \"🇩🇿 +213\",\n name: \"Algeria\",\n value: \"dz\",\n countryCode: \"+213\",\n flag: \"🇩🇿\",\n },\n {\n text: \"🇦🇸 +1684\",\n name: \"American Samoa\",\n value: \"as\",\n countryCode: \"+1684\",\n flag: \"🇦🇸\",\n },\n {\n text: \"🇦🇩 +376\",\n name: \"Andorra\",\n value: \"ad\",\n countryCode: \"+376\",\n flag: \"🇦🇩\",\n },\n {\n text: \"🇦🇴 +244\",\n name: \"Angola\",\n value: \"ao\",\n countryCode: \"+244\",\n flag: \"🇦🇴\",\n },\n {\n text: \"🇦🇮 +1264\",\n name: \"Anguilla\",\n value: \"ai\",\n countryCode: \"+1264\",\n flag: \"🇦🇮\",\n },\n {\n text: \"🇦🇶 +672\",\n name: \"Antarctica\",\n value: \"aq\",\n countryCode: \"+672\",\n flag: \"🇦🇶\",\n },\n {\n text: \"🇦🇬 +1268\",\n name: \"Antigua and Barbuda\",\n value: \"ag\",\n countryCode: \"+1268\",\n flag: \"🇦🇬\",\n },\n {\n text: \"🇦🇷 +54\",\n name: \"Argentina\",\n value: \"ar\",\n countryCode: \"+54\",\n flag: \"🇦🇷\",\n },\n {\n text: \"🇦🇲 +374\",\n name: \"Armenia\",\n value: \"am\",\n countryCode: \"+374\",\n flag: \"🇦🇲\",\n },\n {\n text: \"🇦🇼 +297\",\n name: \"Aruba\",\n value: \"aw\",\n countryCode: \"+297\",\n flag: \"🇦🇼\",\n },\n {\n text: \"🇦🇺 +61\",\n name: \"Australia\",\n value: \"au\",\n countryCode: \"+61\",\n flag: \"🇦🇺\",\n },\n {\n text: \"🇦🇹 +43\",\n name: \"Austria\",\n value: \"at\",\n countryCode: \"+43\",\n flag: \"🇦🇹\",\n },\n {\n text: \"🇦🇿 +994\",\n name: \"Azerbaijan\",\n value: \"az\",\n countryCode: \"+994\",\n flag: \"🇦🇿\",\n },\n {\n text: \"🇧🇸 +1242\",\n name: \"Bahamas\",\n value: \"bs\",\n countryCode: \"+1242\",\n flag: \"🇧🇸\",\n },\n {\n text: \"🇧🇭 +973\",\n name: \"Bahrain\",\n value: \"bh\",\n countryCode: \"+973\",\n flag: \"🇧🇭\",\n },\n {\n text: \"🇧🇩 +880\",\n name: \"Bangladesh\",\n value: \"bd\",\n countryCode: \"+880\",\n flag: \"🇧🇩\",\n },\n {\n text: \"🇧🇧 +1246\",\n name: \"Barbados\",\n value: \"bb\",\n countryCode: \"+1246\",\n flag: \"🇧🇧\",\n },\n {\n text: \"🇧🇾 +375\",\n name: \"Belarus\",\n value: \"by\",\n countryCode: \"+375\",\n flag: \"🇧🇾\",\n },\n {\n text: \"🇧🇪 +32\",\n name: \"Belgium\",\n value: \"be\",\n countryCode: \"+32\",\n flag: \"🇧🇪\",\n },\n {\n text: \"🇧🇿 +501\",\n name: \"Belize\",\n value: \"bz\",\n countryCode: \"+501\",\n flag: \"🇧🇿\",\n },\n {\n text: \"🇧🇯 +229\",\n name: \"Benin\",\n value: \"bj\",\n countryCode: \"+229\",\n flag: \"🇧🇯\",\n },\n {\n text: \"🇧🇲 +1441\",\n name: \"Bermuda\",\n value: \"bm\",\n countryCode: \"+1441\",\n flag: \"🇧🇲\",\n },\n {\n text: \"🇧🇹 +975\",\n name: \"Bhutan\",\n value: \"bt\",\n countryCode: \"+975\",\n flag: \"🇧🇹\",\n },\n {\n text: \"🇧🇴 +591\",\n name: \"Bolivia\",\n value: \"bo\",\n countryCode: \"+591\",\n flag: \"🇧🇴\",\n },\n {\n text: \"🇧🇦 +387\",\n name: \"Bosnia and Herzegovina\",\n value: \"ba\",\n countryCode: \"+387\",\n flag: \"🇧🇦\",\n },\n]\n\nexport const Default = () => {\n return (\n <States<Partial<PhoneInputProps>>\n states={[\n {},\n { placeholder: \"(000) 000 0000\" },\n { placeholder: \"(000) 000 0000\", required: true },\n { placeholder: \"(000) 000 0000\", disabled: true },\n { placeholder: \"(000) 000 0000\", error: \"Something is wrong\" },\n ]}\n >\n <PhoneInput\n options={countriesExample}\n onSelect={(option) => console.log(option)}\n />\n </States>\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAA0D,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE3C;EACbC,KAAK,EAAE;AACT,CAAC;AAAAC,OAAA,CAAAH,OAAA,GAAAC,QAAA;AAED,IAAMG,gBAAgB,GAAG,CACvB;EACEC,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAE,IAAI;EACXC,WAAW,EAAE,KAAK;EAClBC,IAAI,EAAE;AACR,CAAC,EACD;EACEJ,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,IAAI;EACXC,WAAW,EAAE,MAAM;EACnBC,IAAI,EAAE;AACR,CAAC,EACD;EACEJ,IAAI,EAAE,WAAW;EACjBC,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE,IAAI;EACXC,WAAW,EAAE,MAAM;EACnBC,IA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AAQ,EAAE;IAAK,CAAC,EACjD;MAAEF,WAAW,EAAE,gBAAgB;MAAEG,KAAK,EAAE;IAAqB,CAAC;EAC9D,gBAEFxB,MAAA,CAAAO,OAAA,CAAAW,aAAA,CAACd,WAAA,CAAAqB,UAAU;IACTC,OAAO,EAAEf,gBAAiB;IAC1BgB,QAAQ,EAAE,SAAAA,SAACC,MAAM;MAAA,OAAKC,OAAO,CAACC,GAAG,CAACF,MAAM,CAAC;IAAA;EAAC,EAC1C,CACK;AAEb,CAAC;AAAAlB,OAAA,CAAAO,OAAA,GAAAA,OAAA;AAjBYA,OAAO,CAAAc,WAAA"}
@@ -0,0 +1 @@
1
+ export * from "./PhoneInput";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _PhoneInput = require("./PhoneInput");
7
+ Object.keys(_PhoneInput).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _PhoneInput[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _PhoneInput[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_PhoneInput","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../../src/elements/PhoneInput/index.ts"],"sourcesContent":["export * from \"./PhoneInput\"\n"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,9 @@
1
+ export declare const PHONE_INPUT_STATES: {
2
+ default: import("styled-components").FlattenInterpolation<any>[];
3
+ active: import("styled-components").FlattenInterpolation<any>[];
4
+ focus: import("styled-components").FlattenInterpolation<any>[];
5
+ hover: import("styled-components").FlattenInterpolation<any>[];
6
+ completed: import("styled-components").FlattenInterpolation<any>[];
7
+ disabled: import("styled-components").FlattenInterpolation<any>[];
8
+ error: import("styled-components").FlattenInterpolation<any>[];
9
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PHONE_INPUT_STATES = void 0;
7
+ var _themeGet = require("@styled-system/theme-get");
8
+ var _styledComponents = require("styled-components");
9
+ var PHONE_INPUT_STATES = {
10
+ default: (0, _styledComponents.css)(["> div{border-color:", ";}> input{border-color:", ";outline:none;}> input::placeholder,> label{color:", ";}"], (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("colors.black60")),
11
+ active: (0, _styledComponents.css)(["> div,> input{border-color:", ";color:", ";}> input::placeholder{color:", ";}> label{color:", ";}"], (0, _themeGet.themeGet)("colors.blue100"), (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.blue100")),
12
+ focus: (0, _styledComponents.css)(["> div,> input{border-color:", ";}> input::placeholder{color:", ";}> label{color:", ";}"], (0, _themeGet.themeGet)("colors.blue100"), (0, _themeGet.themeGet)("colors.black60"), (0, _themeGet.themeGet)("colors.blue100")),
13
+ hover: (0, _styledComponents.css)(["> div,> input{border-color:", ";}> input::placeholder,> label{color:", ";}"], (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.black100")),
14
+ completed: (0, _styledComponents.css)(["> div,> input{border-color:", ";color:", ";}> label{color:", ";}"], (0, _themeGet.themeGet)("colors.black60"), (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.black60")),
15
+ disabled: (0, _styledComponents.css)(["> div,> input{cursor:default;background-color:transparent;border-color:", ";}> input::placeholder,> label{color:", ";}"], (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("colors.black30")),
16
+ error: (0, _styledComponents.css)(["> div,> input{border-color:", ";}> label{color:", ";}"], (0, _themeGet.themeGet)("colors.red100"), (0, _themeGet.themeGet)("colors.red100"))
17
+ };
18
+ exports.PHONE_INPUT_STATES = PHONE_INPUT_STATES;
19
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","names":["_themeGet","require","_styledComponents","PHONE_INPUT_STATES","default","css","themeGet","active","focus","hover","completed","disabled","error","exports"],"sources":["../../../src/elements/PhoneInput/tokens.tsx"],"sourcesContent":["import { themeGet } from \"@styled-system/theme-get\"\nimport { css } from \"styled-components\"\n\nexport const PHONE_INPUT_STATES = {\n default: css`\n > div {\n border-color: ${themeGet(\"colors.black30\")};\n }\n\n > input {\n border-color: ${themeGet(\"colors.black30\")};\n outline: none;\n }\n\n > input::placeholder,\n > label {\n color: ${themeGet(\"colors.black60\")};\n }\n `,\n active: css`\n > div,\n > input {\n border-color: ${themeGet(\"colors.blue100\")};\n color: ${themeGet(\"colors.black100\")};\n }\n\n > input::placeholder {\n color: ${themeGet(\"colors.black100\")};\n }\n\n > label {\n color: ${themeGet(\"colors.blue100\")};\n }\n `,\n focus: css`\n > div,\n > input {\n border-color: ${themeGet(\"colors.blue100\")};\n }\n\n > input::placeholder {\n color: ${themeGet(\"colors.black60\")};\n }\n\n > label {\n color: ${themeGet(\"colors.blue100\")};\n }\n `,\n hover: css`\n > div,\n > input {\n border-color: ${themeGet(\"colors.black100\")};\n }\n\n > input::placeholder,\n > label {\n color: ${themeGet(\"colors.black100\")};\n }\n `,\n completed: css`\n > div,\n > input {\n border-color: ${themeGet(\"colors.black60\")};\n color: ${themeGet(\"colors.black100\")};\n }\n\n > label {\n color: ${themeGet(\"colors.black60\")};\n }\n `,\n disabled: css`\n > div,\n > input {\n cursor: default;\n background-color: transparent;\n border-color: ${themeGet(\"colors.black30\")};\n }\n\n > input::placeholder,\n > label {\n color: ${themeGet(\"colors.black30\")};\n }\n `,\n error: css`\n > div,\n > input {\n border-color: ${themeGet(\"colors.red100\")};\n }\n\n > label {\n color: ${themeGet(\"colors.red100\")};\n }\n `,\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,IAAME,kBAAkB,GAAG;EAChCC,OAAO,MAAEC,qBAAG,kHAEQ,IAAAC,kBAAQ,EAAC,gBAAgB,CAAC,EAI1B,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,EAMjC,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAEtC;EACDC,MAAM,MAAEF,qBAAG,yGAGS,IAAAC,kBAAQ,EAAC,gBAAgB,CAAC,EACjC,IAAAA,kBAAQ,EAAC,iBAAiB,CAAC,EAI3B,IAAAA,kBAAQ,EAAC,iBAAiB,CAAC,EAI3B,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAEtC;EACDE,KAAK,MAAEH,qBAAG,8FAGU,IAAAC,kBAAQ,EAAC,gBAAgB,CAAC,EAIjC,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,EAI1B,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAEtC;EACDG,KAAK,MAAEJ,qBAAG,kFAGU,IAAAC,kBAAQ,EAAC,iBAAiB,CAAC,EAKlC,IAAAA,kBAAQ,EAAC,iBAAiB,CAAC,CAEvC;EACDI,SAAS,MAAEL,qBAAG,wEAGM,IAAAC,kBAAQ,EAAC,gBAAgB,CAAC,EACjC,IAAAA,kBAAQ,EAAC,iBAAiB,CAAC,EAI3B,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAEtC;EACDK,QAAQ,MAAEN,qBAAG,8HAKO,IAAAC,kBAAQ,EAAC,gBAAgB,CAAC,EAKjC,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAEtC;EACDM,KAAK,MAAEP,qBAAG,6DAGU,IAAAC,kBAAQ,EAAC,eAAe,CAAC,EAIhC,IAAAA,kBAAQ,EAAC,eAAe,CAAC;AAGxC,CAAC;AAAAO,OAAA,CAAAV,kBAAA,GAAAA,kBAAA"}
@@ -1,6 +1,5 @@
1
1
  import React, { ForwardRefExoticComponent, Ref } from "react";
2
2
  import { BoxProps } from "../Box";
3
- import { Variant } from "./types";
4
3
  export interface Option {
5
4
  value: string;
6
5
  text: string;
@@ -16,7 +15,6 @@ export interface SelectProps extends BoxProps, Omit<React.SelectHTMLAttributes<H
16
15
  required?: boolean;
17
16
  selected?: string;
18
17
  title?: string;
19
- variant?: Variant;
20
18
  onSelect?: (value: string) => void;
21
19
  }
22
20
  /** A drop-down select menu */
@@ -9,10 +9,11 @@ var _themeGet = require("@styled-system/theme-get");
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
11
  var _Box = require("../Box");
12
- var _Flex = require("../Flex");
13
12
  var _Text = require("../Text");
14
13
  var _tokens = require("./tokens");
15
- var _excluded = ["description", "disabled", "error", "focus", "hover", "id", "name", "options", "required", "selected", "title", "variant", "onSelect"];
14
+ var _Tooltip = require("../Tooltip");
15
+ var _RequiredField = require("../../shared/RequiredField");
16
+ var _excluded = ["description", "disabled", "error", "focus", "hover", "id", "name", "options", "required", "selected", "title", "onSelect"];
16
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
19
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -37,8 +38,6 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
37
38
  required = _ref.required,
38
39
  selected = _ref.selected,
39
40
  title = _ref.title,
40
- _ref$variant = _ref.variant,
41
- variant = _ref$variant === void 0 ? "default" : _ref$variant,
42
41
  onSelect = _ref.onSelect,
43
42
  rest = _objectWithoutProperties(_ref, _excluded);
44
43
  var _splitBoxProps = (0, _Box.splitBoxProps)(rest),
@@ -47,32 +46,20 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
47
46
  selectProps = _splitBoxProps2[1];
48
47
  return /*#__PURE__*/_react.default.createElement(_Box.Box, _extends({
49
48
  width: "100%"
50
- }, boxProps), /*#__PURE__*/_react.default.createElement(_Flex.Flex, _extends({
51
- as: "label"
52
- }, variant === "inline" ? {
53
- flexDirection: "row",
54
- alignItems: "center"
55
- } : {
56
- flexDirection: "column",
57
- alignItems: "flex-start"
58
- }, id ? {
59
- for: id
60
- } : {}), /*#__PURE__*/_react.default.createElement("div", null, title && /*#__PURE__*/_react.default.createElement(_Text.Text, {
49
+ }, boxProps), !!description && /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
50
+ pointer: true,
51
+ content: description,
52
+ placement: "top-end"
53
+ }, /*#__PURE__*/_react.default.createElement(_Text.Text, {
61
54
  variant: "xs",
62
- lineHeight: variant === "inline" && description === undefined ? 1 : undefined
63
- }, title, required && /*#__PURE__*/_react.default.createElement(_Box.Box, {
64
- as: "span",
65
- color: "brand"
66
- }, "*")), description && /*#__PURE__*/_react.default.createElement(_Text.Text, {
67
- variant: "xs",
68
- color: "black60"
69
- }, description)), /*#__PURE__*/_react.default.createElement(Container, {
70
- variant: variant,
55
+ color: "black60",
56
+ textAlign: "right"
57
+ }, /*#__PURE__*/_react.default.createElement("u", null, "What is this?"))), /*#__PURE__*/_react.default.createElement(Container, {
71
58
  disabled: !!disabled,
72
59
  hover: !!hover,
73
60
  error: error,
74
61
  focus: !!focus,
75
- mt: variant !== "inline" && (title || description) ? 0.5 : 0
62
+ title: title
76
63
  }, /*#__PURE__*/_react.default.createElement("select", _extends({
77
64
  ref: ref,
78
65
  id: id,
@@ -89,9 +76,15 @@ var Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
89
76
  value: value,
90
77
  key: value
91
78
  }, text);
92
- })))), error && typeof error === "string" && /*#__PURE__*/_react.default.createElement(_Text.Text, {
79
+ })), !!title && /*#__PURE__*/_react.default.createElement(StyledLabel, {
80
+ htmlFor: id
81
+ }, title)), required && !(error && typeof error === "string") && /*#__PURE__*/_react.default.createElement(_RequiredField.RequiredField, {
82
+ mt: 0.5,
83
+ ml: 1
84
+ }), error && typeof error === "string" && /*#__PURE__*/_react.default.createElement(_Text.Text, {
93
85
  variant: "xs",
94
86
  mt: 0.5,
87
+ ml: 1,
95
88
  color: "red100"
96
89
  }, error));
97
90
  });
@@ -108,7 +101,11 @@ exports.caretMixin = caretMixin;
108
101
  var Container = (0, _styledComponents.default)(_Box.Box).withConfig({
109
102
  displayName: "Select__Container",
110
103
  componentId: "sc-1weszjl-0"
111
- })(["position:relative;width:100%;> select{", ";width:100%;padding:0 24px 0 ", ";font-family:", ";border:0;border-bottom:1px solid;cursor:pointer;line-height:1;transition:color 0.25s,background-color 0.25s,border-color 0.25s;", ";}", ""], resetMixin, (0, _themeGet.themeGet)("space.1"), (0, _themeGet.themeGet)("fonts.sans"), function (props) {
112
- return (0, _styledComponents.css)(["", " ", " ", " ", " ", " &:hover{", "}&:focus{", "}&:disabled{cursor:default;", "}"], _tokens.SELECT_STATES.default, props.hover && _tokens.SELECT_STATES.hover, props.focus && _tokens.SELECT_STATES.focus, props.disabled && _tokens.SELECT_STATES.disabled, props.error && _tokens.SELECT_STATES.error, _tokens.SELECT_STATES.hover, _tokens.SELECT_STATES.focus, _tokens.SELECT_STATES.disabled);
104
+ })(["position:relative;width:100%;> select{", ";width:100%;padding:0 24px 0 ", ";font-family:", ";border:1px solid;border-radius:3px;border-color:", ";cursor:pointer;line-height:1;transition:color 0.25s,background-color 0.25s,border-color 0.25s;", ";}", ""], resetMixin, (0, _themeGet.themeGet)("space.1"), (0, _themeGet.themeGet)("fonts.sans"), (0, _themeGet.themeGet)("colors.black30"), function (props) {
105
+ return (0, _styledComponents.css)(["", " ", " ", " ", " ", " &:hover{", "}&:focus{", "}&:disabled{cursor:default;", "}&:not(:has(option[value=\"\"]:checked)):not(:focus){", " ", "}&:not(:focus):has(option[value=\"\"]:checked){", "}"], _tokens.SELECT_STATES.default, props.hover && _tokens.SELECT_STATES.hover, props.focus && _tokens.SELECT_STATES.focus, props.disabled && _tokens.SELECT_STATES.disabled, props.error && _tokens.SELECT_STATES.error, _tokens.SELECT_STATES.hover, _tokens.SELECT_STATES.focus, _tokens.SELECT_STATES.disabled, !(props.disabled || props.focus) && _tokens.SELECT_STATES.completed, props.error && _tokens.SELECT_STATES.error, props.title && (0, _styledComponents.css)(["color:transparent;"]));
113
106
  }, caretMixin);
107
+ var StyledLabel = _styledComponents.default.label.withConfig({
108
+ displayName: "Select__StyledLabel",
109
+ componentId: "sc-1weszjl-1"
110
+ })(["position:absolute;top:50%;left:5px;padding:0 5px;pointer-events:none;transform:translateY(-50%);transition:0.25s cubic-bezier(0.64,0.05,0.36,1);transision-property:color,font-size,transform;background-color:", ";font-family:", ";"], (0, _themeGet.themeGet)("colors.white100"), (0, _themeGet.themeGet)("fonts.sans"));
114
111
  //# sourceMappingURL=Select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":["_themeGet","require","_react","_interopRequireWildcard","_styledComponents","_Box","_Flex","_Text","_tokens","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","Select","forwardRef","_ref","ref","description","disabled","error","focus","hover","id","options","required","selected","title","_ref$variant","variant","onSelect","rest","_splitBoxProps","splitBoxProps","_splitBoxProps2","boxProps","selectProps","createElement","Box","width","Flex","as","flexDirection","alignItems","for","Text","lineHeight","undefined","color","Container","mt","onChange","event","map","_ref2","text","exports","displayName","resetMixin","css","caretMixin","themeGet","_ref3","styled","withConfig","componentId","props","SELECT_STATES"],"sources":["../../../src/elements/Select/Select.tsx"],"sourcesContent":["import { themeGet } from \"@styled-system/theme-get\"\nimport React, { forwardRef, ForwardRefExoticComponent, Ref } from \"react\"\nimport styled, { css } from \"styled-components\"\nimport { Box, BoxProps, splitBoxProps } from \"../Box\"\nimport { Flex } from \"../Flex\"\nimport { Text } from \"../Text\"\nimport { Variant } from \"./types\"\nimport { SELECT_STATES } from \"./tokens\"\n\nexport interface Option {\n value: string\n text: string\n}\n\nexport interface SelectProps\n extends BoxProps,\n Omit<React.SelectHTMLAttributes<HTMLSelectElement>, \"onSelect\" | \"size\"> {\n description?: string\n disabled?: boolean\n error?: string | boolean\n focus?: boolean\n hover?: boolean\n name?: string\n options: Option[]\n required?: boolean\n selected?: string\n title?: string\n variant?: Variant\n onSelect?: (value: string) => void\n}\n\n/** A drop-down select menu */\nexport const Select: ForwardRefExoticComponent<\n SelectProps & { ref?: Ref<HTMLElement> }\n> = forwardRef(\n (\n {\n description,\n disabled,\n error,\n focus,\n hover,\n id,\n name,\n options,\n required,\n selected,\n title,\n variant = \"default\",\n onSelect,\n ...rest\n },\n ref\n ) => {\n const [boxProps, selectProps] = splitBoxProps(rest)\n\n return (\n <Box width=\"100%\" {...boxProps}>\n <Flex\n as=\"label\"\n {...(variant === \"inline\"\n ? {\n flexDirection: \"row\",\n alignItems: \"center\",\n }\n : {\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n })}\n {...(id ? { for: id } : {})}\n >\n <div>\n {title && (\n <Text\n variant=\"xs\"\n lineHeight={\n variant === \"inline\" && description === undefined\n ? 1\n : undefined\n }\n >\n {title}\n {required && (\n <Box as=\"span\" color=\"brand\">\n *\n </Box>\n )}\n </Text>\n )}\n\n {description && (\n <Text variant=\"xs\" color=\"black60\">\n {description}\n </Text>\n )}\n </div>\n\n <Container\n variant={variant}\n disabled={!!disabled}\n hover={!!hover}\n error={error!}\n focus={!!focus}\n mt={variant !== \"inline\" && (title || description) ? 0.5 : 0}\n >\n <select\n ref={ref as any}\n id={id}\n disabled={disabled}\n name={name}\n value={selected}\n onChange={(event) => {\n onSelect && onSelect(event.target.value)\n }}\n {...selectProps}\n >\n {options.map(({ value, text }) => {\n return (\n <option value={value} key={value}>\n {text}\n </option>\n )\n })}\n </select>\n </Container>\n </Flex>\n\n {error && typeof error === \"string\" && (\n <Text variant=\"xs\" mt={0.5} color=\"red100\">\n {error}\n </Text>\n )}\n </Box>\n )\n }\n)\n\nSelect.displayName = \"Select\"\n\nconst resetMixin = css`\n appearance: none;\n background: none;\n border: none;\n outline: 0;\n text-indent: 0.01px;\n text-overflow: \"\";\n border-radius: 0;\n\n &:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 black;\n }\n\n option:not(:checked) {\n color: black; /* prevent <option>s from becoming transparent as well */\n }\n`\n\n/** Creates a small caret */\nexport const caretMixin = css`\n &::after {\n content: \"\";\n cursor: inherit;\n width: 0;\n height: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: ${themeGet(\"space.1\")};\n pointer-events: none;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 4px solid\n ${({ disabled }) => {\n return disabled\n ? themeGet(\"colors.black10\")\n : themeGet(\"colors.black100\")\n }};\n }\n`\n\ntype ContainerProps = Required<\n Pick<SelectProps, \"variant\" | \"disabled\" | \"error\" | \"hover\" | \"focus\">\n>\n\nconst Container = styled(Box)<ContainerProps>`\n position: relative;\n width: 100%;\n\n > select {\n ${resetMixin};\n width: 100%;\n /* 24px = space.1 + 4px-wide caret + space.1 */\n padding: 0 24px 0 ${themeGet(\"space.1\")};\n font-family: ${themeGet(\"fonts.sans\")};\n border: 0;\n border-bottom: 1px solid;\n cursor: pointer;\n line-height: 1;\n transition: color 0.25s, background-color 0.25s, border-color 0.25s;\n\n ${(props) => {\n return css`\n ${SELECT_STATES.default}\n\n ${props.hover && SELECT_STATES.hover}\n ${props.focus && SELECT_STATES.focus}\n ${props.disabled && SELECT_STATES.disabled}\n ${props.error && SELECT_STATES.error}\n\n &:hover {\n ${SELECT_STATES.hover}\n }\n\n &:focus {\n ${SELECT_STATES.focus}\n }\n\n &:disabled {\n cursor: default;\n ${SELECT_STATES.disabled}\n }\n `\n }};\n }\n\n ${caretMixin}\n`\n"],"mappings":";;;;;;;AAAA,IAAAA,SAAA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,qBAAa,CAAC/C,KAAK,EAGhC+C,qBAAa,CAAC7C,KAAK,EAInB6C,qBAAa,CAAC9C,KAAK,EAKnB8C,qBAAa,CAAChD,QAAQ;AAG9B,CAAC,EAGDyC,UAAU,CACb"}
1
+ {"version":3,"file":"Select.js","names":["_themeGet","require","_react","_interopRequireWildcard","_styledComponents","_Box","_Text","_tokens","_Tooltip","_RequiredField","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","Select","forwardRef","_ref","ref","description","disabled","error","focus","hover","id","options","required","selected","title","onSelect","rest","_splitBoxProps","splitBoxProps","_splitBoxProps2","boxProps","selectProps","createElement","Box","width","Tooltip","pointer","content","placement","Text","variant","color","textAlign","Container","onChange","event","map","_ref2","text","StyledLabel","htmlFor","RequiredField","mt","ml","exports","displayName","resetMixin","css","caretMixin","themeGet","_ref3","styled","withConfig","componentId","props","SELECT_STATES","completed","label"],"sources":["../../../src/elements/Select/Select.tsx"],"sourcesContent":["import { themeGet } from \"@styled-system/theme-get\"\nimport React, { forwardRef, ForwardRefExoticComponent, Ref } from \"react\"\nimport styled, { css } from \"styled-components\"\nimport { Box, BoxProps, splitBoxProps } from \"../Box\"\nimport { Text } from \"../Text\"\nimport { SELECT_STATES } from \"./tokens\"\nimport { Tooltip } from \"../Tooltip\"\nimport { RequiredField } from \"../../shared/RequiredField\"\n\nexport interface Option {\n value: string\n text: string\n}\n\nexport interface SelectProps\n extends BoxProps,\n Omit<React.SelectHTMLAttributes<HTMLSelectElement>, \"onSelect\" | \"size\"> {\n description?: string\n disabled?: boolean\n error?: string | boolean\n focus?: boolean\n hover?: boolean\n name?: string\n options: Option[]\n required?: boolean\n selected?: string\n title?: string\n onSelect?: (value: string) => void\n}\n\n/** A drop-down select menu */\nexport const Select: ForwardRefExoticComponent<\n SelectProps & { ref?: Ref<HTMLElement> }\n> = forwardRef(\n (\n {\n description,\n disabled,\n error,\n focus,\n hover,\n id,\n name,\n options,\n required,\n selected,\n title,\n onSelect,\n ...rest\n },\n ref\n ) => {\n const [boxProps, selectProps] = splitBoxProps(rest)\n\n return (\n <Box width=\"100%\" {...boxProps}>\n {!!description && (\n <Tooltip pointer content={description} placement=\"top-end\">\n <Text variant=\"xs\" color=\"black60\" textAlign=\"right\">\n <u>What is this?</u>\n </Text>\n </Tooltip>\n )}\n\n <Container\n disabled={!!disabled}\n hover={!!hover}\n error={error!}\n focus={!!focus}\n title={title}\n >\n <select\n ref={ref as any}\n id={id}\n disabled={disabled}\n name={name}\n value={selected}\n onChange={(event) => {\n onSelect && onSelect(event.target.value)\n }}\n {...selectProps}\n >\n {options.map(({ value, text }) => {\n return (\n <option value={value} key={value}>\n {text}\n </option>\n )\n })}\n </select>\n\n {!!title && <StyledLabel htmlFor={id}>{title}</StyledLabel>}\n </Container>\n\n {required && !(error && typeof error === \"string\") && (\n <RequiredField mt={0.5} ml={1} />\n )}\n\n {error && typeof error === \"string\" && (\n <Text variant=\"xs\" mt={0.5} ml={1} color=\"red100\">\n {error}\n </Text>\n )}\n </Box>\n )\n }\n)\n\nSelect.displayName = \"Select\"\n\nconst resetMixin = css`\n appearance: none;\n background: none;\n border: none;\n outline: 0;\n text-indent: 0.01px;\n text-overflow: \"\";\n border-radius: 0;\n\n &:-moz-focusring {\n color: transparent;\n text-shadow: 0 0 0 black;\n }\n\n option:not(:checked) {\n color: black; /* prevent <option>s from becoming transparent as well */\n }\n`\n\n/** Creates a small caret */\nexport const caretMixin = css`\n &::after {\n content: \"\";\n cursor: inherit;\n width: 0;\n height: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: ${themeGet(\"space.1\")};\n pointer-events: none;\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 4px solid\n ${({ disabled }) => {\n return disabled\n ? themeGet(\"colors.black10\")\n : themeGet(\"colors.black100\")\n }};\n }\n`\n\ntype ContainerProps = Required<\n Pick<SelectProps, \"disabled\" | \"error\" | \"hover\" | \"focus\">\n>\n\nconst Container = styled(Box)<ContainerProps>`\n position: relative;\n width: 100%;\n\n > select {\n ${resetMixin};\n width: 100%;\n /* 24px = space.1 + 4px-wide caret + space.1 */\n padding: 0 24px 0 ${themeGet(\"space.1\")};\n font-family: ${themeGet(\"fonts.sans\")};\n border: 1px solid;\n border-radius: 3px;\n border-color: ${themeGet(\"colors.black30\")};\n cursor: pointer;\n line-height: 1;\n transition: color 0.25s, background-color 0.25s, border-color 0.25s;\n\n ${(props) => {\n return css`\n ${SELECT_STATES.default}\n\n ${props.hover && SELECT_STATES.hover}\n ${props.focus && SELECT_STATES.focus}\n ${props.disabled && SELECT_STATES.disabled}\n ${props.error && SELECT_STATES.error}\n\n &:hover {\n ${SELECT_STATES.hover}\n }\n\n &:focus {\n ${SELECT_STATES.focus}\n }\n\n &:disabled {\n cursor: default;\n ${SELECT_STATES.disabled}\n }\n\n &:not(:has(option[value=\"\"]:checked)):not(:focus) {\n ${!(props.disabled || props.focus) && SELECT_STATES.completed}\n ${props.error && SELECT_STATES.error}\n }\n\n &:not(:focus):has(option[value=\"\"]:checked) {\n ${props.title &&\n css`\n color: transparent;\n `}\n }\n `\n }};\n }\n\n ${caretMixin}\n`\n\nconst StyledLabel = styled.label`\n position: absolute;\n top: 50%;\n left: 5px;\n padding: 0 5px;\n pointer-events: none;\n transform: translateY(-50%);\n transition: 0.25s cubic-bezier(0.64, 0.05, 0.36, 1);\n transision-property: color, font-size, transform;\n background-color: ${themeGet(\"colors.white100\")};\n font-family: ${themeGet(\"fonts.sans\")};\n`\n"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AAA0D,IAAAS,SAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,4BAAAG,OAAA,EAAAH,GAAA,UAAAI,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAL,GAAA,YAAAI,KAAA,CAAAE,GAAA,CAAAN,GAAA,SAAAO,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAZ,GAAA,QAAAY,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAf,GAAA,EAAAY,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAX,GAAA,EAAAY,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AAIgD,KAAK,CAAC9C,KAAK,CAAC,IAAI+C,qBAAa,CAACC,SAAS,EAC3DF,KAAK,CAAC/C,KAAK,IAAIgD,qBAAa,CAAChD,KAAK,EAIlC+C,KAAK,CAACxC,KAAK,QACbiC,qBAAG,yBAEF;AAGP,CAAC,EAGDC,UAAU,CACb;AAED,IAAMT,WAAW,GAAGY,yBAAM,CAACM,KAAK,CAAAL,UAAA;EAAAP,WAAA;EAAAQ,WAAA;AAAA,8OASV,IAAAJ,kBAAQ,EAAC,iBAAiB,CAAC,EAChC,IAAAA,kBAAQ,EAAC,YAAY,CAAC,CACtC"}
@@ -3,4 +3,3 @@ declare const _default: {
3
3
  };
4
4
  export default _default;
5
5
  export declare const Default: () => JSX.Element;
6
- export declare const Example: () => JSX.Element;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.Example = exports.Default = void 0;
6
+ exports.default = exports.Default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _storybookStates = require("storybook-states");
9
9
  var _Select = require("./Select");
@@ -13,6 +13,9 @@ var _default = {
13
13
  };
14
14
  exports.default = _default;
15
15
  var OPTIONS = [{
16
+ text: "Please select",
17
+ value: ""
18
+ }, {
16
19
  text: "Default",
17
20
  value: "-decayed_merch"
18
21
  }, {
@@ -36,9 +39,7 @@ var OPTIONS = [{
36
39
  }];
37
40
  var Default = function Default() {
38
41
  return /*#__PURE__*/_react.default.createElement(_storybookStates.States, {
39
- states: [
40
- // variant="default"
41
- {}, {
42
+ states: [{}, {
42
43
  focus: true
43
44
  }, {
44
45
  hover: true
@@ -46,35 +47,28 @@ var Default = function Default() {
46
47
  error: "Something went wrong."
47
48
  }, {
48
49
  disabled: true
49
- },
50
- // variant="inline"
51
- {
52
- variant: "inline"
53
50
  }, {
54
- variant: "inline",
51
+ title: "Sort"
52
+ }, {
53
+ title: "Sort",
54
+ description: "A description of sorting"
55
+ }, {
56
+ title: "Sort",
55
57
  focus: true
56
58
  }, {
57
- variant: "inline",
59
+ title: "Sort",
58
60
  hover: true
59
61
  }, {
60
- variant: "inline",
62
+ title: "Sort",
61
63
  error: "Something went wrong."
62
64
  }, {
63
- variant: "inline",
65
+ title: "Sort",
64
66
  disabled: true
65
67
  }, {
66
- variant: "inline",
67
- title: "Sort:"
68
+ title: "Sort",
69
+ required: true
68
70
  }, {
69
- variant: "inline",
70
- title: "Sort:",
71
- description: "A description of sorting"
72
- },
73
- // variant="default"
74
- {
75
71
  selected: "lastValue"
76
- }, {
77
- title: "Pick something"
78
72
  }, {
79
73
  title: "Pick something",
80
74
  required: true,
@@ -89,16 +83,4 @@ var Default = function Default() {
89
83
  };
90
84
  exports.Default = Default;
91
85
  Default.displayName = "Default";
92
- var Example = function Example() {
93
- return /*#__PURE__*/_react.default.createElement(_Select.Select, {
94
- display: "inline-flex",
95
- variant: "inline",
96
- title: "Sort:",
97
- options: OPTIONS,
98
- selected: "-year",
99
- autoComplete: "year"
100
- });
101
- };
102
- exports.Example = Example;
103
- Example.displayName = "Example";
104
86
  //# sourceMappingURL=Select.story.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.story.js","names":["_react","_interopRequireDefault","require","_storybookStates","_Select","obj","__esModule","default","_default","title","exports","OPTIONS","text","value","Default","createElement","States","states","focus","hover","error","disabled","variant","description","selected","required","id","Select","options","displayName","Example","display","autoComplete"],"sources":["../../../src/elements/Select/Select.story.tsx"],"sourcesContent":["import React from \"react\"\nimport { States } from \"storybook-states\"\nimport { Select, SelectProps } from \"./Select\"\n\nexport default {\n title: \"Components/Select\",\n}\n\nconst OPTIONS = [\n { text: \"Default\", value: \"-decayed_merch\" },\n { text: \"Price (desc.)\", value: \"-has_price,-prices\" },\n { text: \"Price (asc.)\", value: \"-has_price,prices\" },\n { text: \"Recently updated\", value: \"-partner_updated_at\" },\n { text: \"Recently added\", value: \"-published_at\" },\n { text: \"Artwork year (desc.)\", value: \"-year\" },\n { text: \"Artwork year (asc.)\", value: \"year\" },\n]\n\nexport const Default = () => {\n return (\n <States<Partial<SelectProps>>\n states={[\n // variant=\"default\"\n {},\n { focus: true },\n { hover: true },\n { error: \"Something went wrong.\" },\n { disabled: true },\n\n // variant=\"inline\"\n { variant: \"inline\" },\n { variant: \"inline\", focus: true },\n { variant: \"inline\", hover: true },\n { variant: \"inline\", error: \"Something went wrong.\" },\n { variant: \"inline\", disabled: true },\n { variant: \"inline\", title: \"Sort:\" },\n {\n variant: \"inline\",\n title: \"Sort:\",\n description: \"A description of sorting\",\n },\n\n // variant=\"default\"\n { selected: \"lastValue\" },\n { title: \"Pick something\" },\n { title: \"Pick something\", required: true, id: \"pick\" },\n { title: \"Pick something\", description: \"This matters a lot.\" },\n ]}\n >\n <Select options={OPTIONS} />\n </States>\n )\n}\n\nexport const Example = () => {\n return (\n <Select\n display=\"inline-flex\"\n variant=\"inline\"\n title=\"Sort:\"\n options={OPTIONS}\n selected=\"-year\"\n autoComplete=\"year\"\n />\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAA8C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE/B;EACbC,KAAK,EAAE;AACT,CAAC;AAAAC,OAAA,CAAAH,OAAA,GAAAC,QAAA;AAED,IAAMG,OAAO,GAAG,CACd;EAAEC,IAAI,EAAE,SAAS;EAAEC,KAAK,EAAE;AAAiB,CAAC,EAC5C;EAAED,IAAI,EAAE,eAAe;EAAEC,KAAK,EAAE;AAAqB,CAAC,EACtD;EAAED,IAAI,EAAE,cAAc;EAAEC,KAAK,EAAE;AAAoB,CAAC,EACpD;EAAED,IAAI,EAAE,kBAAkB;EAAEC,KAAK,EAAE;AAAsB,CAAC,EAC1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O,OAAA,CAAAQ,aAAA,CAACX,OAAA,CAAAuB,MAAM;IAACC,OAAO,EAAEjB;EAAQ,EAAG,CACrB;AAEb,CAAC;AAAAD,OAAA,CAAAI,OAAA,GAAAA,OAAA;AAlCYA,OAAO,CAAAe,WAAA;AAoCb,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAA,EAAS;EAC3B,oBACE9B,MAAA,CAAAO,OAAA,CAAAQ,aAAA,CAACX,OAAA,CAAAuB,MAAM;IACLI,OAAO,EAAC,aAAa;IACrBT,OAAO,EAAC,QAAQ;IAChBb,KAAK,EAAC,OAAO;IACbmB,OAAO,EAAEjB,OAAQ;IACjBa,QAAQ,EAAC,OAAO;IAChBQ,YAAY,EAAC;EAAM,EACnB;AAEN,CAAC;AAAAtB,OAAA,CAAAoB,OAAA,GAAAA,OAAA;AAXYA,OAAO,CAAAD,WAAA"}
1
+ {"version":3,"file":"Select.story.js","names":["_react","_interopRequireDefault","require","_storybookStates","_Select","obj","__esModule","default","_default","title","exports","OPTIONS","text","value","Default","createElement","States","states","focus","hover","error","disabled","description","required","selected","id","Select","options","displayName"],"sources":["../../../src/elements/Select/Select.story.tsx"],"sourcesContent":["import React from \"react\"\nimport { States } from \"storybook-states\"\nimport { Select, SelectProps } from \"./Select\"\n\nexport default {\n title: \"Components/Select\",\n}\n\nconst OPTIONS = [\n { text: \"Please select\", value: \"\" },\n { text: \"Default\", value: \"-decayed_merch\" },\n { text: \"Price (desc.)\", value: \"-has_price,-prices\" },\n { text: \"Price (asc.)\", value: \"-has_price,prices\" },\n { text: \"Recently updated\", value: \"-partner_updated_at\" },\n { text: \"Recently added\", value: \"-published_at\" },\n { text: \"Artwork year (desc.)\", value: \"-year\" },\n { text: \"Artwork year (asc.)\", value: \"year\" },\n]\n\nexport const Default = () => {\n return (\n <States<Partial<SelectProps>>\n states={[\n {},\n { focus: true },\n { hover: true },\n { error: \"Something went wrong.\" },\n { disabled: true },\n { title: \"Sort\" },\n { title: \"Sort\", description: \"A description of sorting\" },\n { title: \"Sort\", focus: true },\n { title: \"Sort\", hover: true },\n { title: \"Sort\", error: \"Something went wrong.\" },\n { title: \"Sort\", disabled: true },\n { title: \"Sort\", required: true },\n { selected: \"lastValue\" },\n { title: \"Pick something\", required: true, id: \"pick\" },\n { title: \"Pick something\", description: \"This matters a lot.\" },\n ]}\n >\n <Select options={OPTIONS} />\n </States>\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAA8C,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,IAAAG,QAAA,GAE/B;EACbC,KAAK,EAAE;AACT,CAAC;AAAAC,OAAA,CAAAH,OAAA,GAAAC,QAAA;AAED,IAAMG,OAAO,GAAG,CACd;EAAEC,IAAI,EAAE,eAAe;EAAEC,KAAK,EAAE;AAAG,CAAC,EACpC;EAAED,IAAI,EAAE,SAAS;EAAEC,KAAK,EAAE;AAAiB,CAAC,EAC5C;EAAED,IAAI,EAAE,eAAe;EAAEC,KAAK,EAAE;AAAqB,CAAC,EACtD;EAAED,IAAI,EAAE,cAAc;EAAEC,KAAK,EAAE;AAAoB,CAAC,EACpD;EAAED,IAAI,EAAE,kBAAkB;EAAEC,KAAK,EAAE;AAAsB,CAAC,EAC1D;EAAED,IAAI,EAAE,gBAAgB;EAAEC,KAAK,EAAE;AAAgB,CAAC,EAClD;EAAED,IAAI,EAAE,sBAAsB;EAAEC,KAAK,EAAE;AAAQ,CAAC,EAChD;EAAED,IAAI,EAAE,qBAAqB;EAAEC,KAAK,EAAE;AAAO,CAAC,CAC/C;AAEM,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAA,EAAS;EAC3B,oBACEd,MAAA,CAAAO,OAAA,CAAAQ,aAAA,CAACZ,gBAAA,CAAAa,MAAM;IACLC,MAAM,EAAE,CACN,CAAC,CAAC,EACF;MAAEC,KAAK,EAAE;IAAK,CAAC,EACf;MAAEC,KAAK,EAAE;IAAK,CAAC,EACf;MAAEC,KAAK,EAAE;IAAwB,CAAC,EAClC;MAAEC,QAAQ,EAAE;IAAK,CAAC,EAClB;MAAEZ,KAAK,EAAE;IAAO,CAAC,EACjB;MAAEA,KAAK,EAAE,MAAM;MAAEa,WAAW,EAAE;IAA2B,CAAC,EAC1D;MAAEb,KAAK,EAAE,MAAM;MAAES,KAAK,EAAE;IAAK,CAAC,EAC9B;MAAET,KAAK,EAAE,MAAM;MAAEU,KAAK,EAAE;IAAK,CAAC,EAC9B;MAAEV,KAAK,EAAE,MAAM;MAAEW,KAAK,EAAE;IAAwB,CAAC,EACjD;MAAEX,KAAK,EAAE,MAAM;MAAEY,QAAQ,EAAE;IAAK,CAAC,EACjC;MAAEZ,KAAK,EAAE,MAAM;MAAEc,QAAQ,EAAE;IAAK,CAAC,EACjC;MAAEC,QAAQ,EAAE;IAAY,CAAC,EACzB;MAAEf,KAAK,EAAE,gBAAgB;MAAEc,QAAQ,EAAE,IAAI;MAAEE,EAAE,EAAE;IAAO,CAAC,EACvD;MAAEhB,KAAK,EAAE,gBAAgB;MAAEa,WAAW,EAAE;IAAsB,CAAC;EAC/D,gBAEFtB,MAAA,CAAAO,OAAA,CAAAQ,aAAA,CAACX,OAAA,CAAAsB,MAAM;IAACC,OAAO,EAAEhB;EAAQ,EAAG,CACrB;AAEb,CAAC;AAAAD,OAAA,CAAAI,OAAA,GAAAA,OAAA;AAxBYA,OAAO,CAAAc,WAAA"}
@@ -1,7 +1,2 @@
1
- export declare const SELECT_STATES: {
2
- default: import("styled-components").FlattenInterpolation<any>[];
3
- focus: import("styled-components").FlattenInterpolation<any>[];
4
- hover: import("styled-components").FlattenInterpolation<any>[];
5
- disabled: import("styled-components").FlattenInterpolation<any>[];
6
- error: import("styled-components").FlattenInterpolation<any>[];
7
- };
1
+ import { State } from "./types";
2
+ export declare const SELECT_STATES: Record<State, any>;
@@ -7,11 +7,12 @@ exports.SELECT_STATES = void 0;
7
7
  var _themeGet = require("@styled-system/theme-get");
8
8
  var _styledComponents = require("styled-components");
9
9
  var SELECT_STATES = {
10
- default: (0, _styledComponents.css)(["height:50px;font-size:", ";color:", ";border-color:", ";"], (0, _themeGet.themeGet)("textVariants.sm.fontSize"), (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.black60")),
11
- focus: (0, _styledComponents.css)(["color:", ";border-color:", ";text-decoration:underline;"], (0, _themeGet.themeGet)("colors.blue100"), (0, _themeGet.themeGet)("colors.black60")),
12
- hover: (0, _styledComponents.css)(["color:", ";border-color:", ";text-decoration:underline;"], (0, _themeGet.themeGet)("colors.blue100"), (0, _themeGet.themeGet)("colors.black60")),
13
- disabled: (0, _styledComponents.css)(["color:", ";border-color:", ";text-decoration:none;"], (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("colors.black30")),
14
- error: (0, _styledComponents.css)(["color:", ";border-color:", ";"], (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.red100"))
10
+ default: (0, _styledComponents.css)(["height:50px;font-size:", ";color:", ";border-color:", ";+ label{color:", ";font-size:", ";}&:not(:has(option[value=\"\"]:checked)) + label{transform:translateY(-150%);font-size:", ";}"], (0, _themeGet.themeGet)("textVariants.sm-display.fontSize"), (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("colors.black60"), (0, _themeGet.themeGet)("textVariants.sm-display.fontSize"), (0, _themeGet.themeGet)("textVariants.xs.fontSize")),
11
+ focus: (0, _styledComponents.css)(["color:", ";border-color:", ";text-decoration:underline;+ label{color:", ";transform:translateY(-150%);font-size:", ";}&:has(option[value=\"\"]:checked) + label{text-decoration:underline;}"], (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.blue100"), (0, _themeGet.themeGet)("colors.blue100"), (0, _themeGet.themeGet)("textVariants.xs.fontSize")),
12
+ hover: (0, _styledComponents.css)(["color:", ";border-color:", ";text-decoration:underline;+ label{color:", ";}&:has(option[value=\"\"]:checked):not(:disabled) + label{color:", ";text-decoration:underline;}"], (0, _themeGet.themeGet)("colors.blue100"), (0, _themeGet.themeGet)("colors.black60"), (0, _themeGet.themeGet)("colors.black60"), (0, _themeGet.themeGet)("colors.blue100")),
13
+ completed: (0, _styledComponents.css)(["border-color:", ";text-decoration:none;+ label{color:", ";}&:not(:has(option[value=\"\"]:checked)) + label{transform:translateY(-150%);font-size:", ";}"], (0, _themeGet.themeGet)("colors.black60"), (0, _themeGet.themeGet)("colors.black60"), (0, _themeGet.themeGet)("textVariants.xs.fontSize")),
14
+ disabled: (0, _styledComponents.css)(["color:", ";border-color:", ";text-decoration:none;+ label{color:", ";text-decoration:none;}&:not(:has(option[value=\"\"]:checked)) + label{transform:translateY(-150%);font-size:", ";}"], (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("colors.black30"), (0, _themeGet.themeGet)("textVariants.xs.fontSize")),
15
+ error: (0, _styledComponents.css)(["color:", ";border-color:", ";+ label{color:", ";}"], (0, _themeGet.themeGet)("colors.black100"), (0, _themeGet.themeGet)("colors.red100"), (0, _themeGet.themeGet)("colors.red100"))
15
16
  };
16
17
  exports.SELECT_STATES = SELECT_STATES;
17
18
  //# sourceMappingURL=tokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","names":["_themeGet","require","_styledComponents","SELECT_STATES","default","css","themeGet","focus","hover","disabled","error","exports"],"sources":["../../../src/elements/Select/tokens.ts"],"sourcesContent":["import { themeGet } from \"@styled-system/theme-get\"\nimport { css } from \"styled-components\"\n\nexport const SELECT_STATES = {\n default: css`\n height: 50px;\n font-size: ${themeGet(\"textVariants.sm.fontSize\")};\n color: ${themeGet(\"colors.black100\")};\n border-color: ${themeGet(\"colors.black60\")};\n `,\n focus: css`\n color: ${themeGet(\"colors.blue100\")};\n border-color: ${themeGet(\"colors.black60\")};\n text-decoration: underline;\n `,\n hover: css`\n color: ${themeGet(\"colors.blue100\")};\n border-color: ${themeGet(\"colors.black60\")};\n text-decoration: underline;\n `,\n disabled: css`\n color: ${themeGet(\"colors.black30\")};\n border-color: ${themeGet(\"colors.black30\")};\n text-decoration: none;\n `,\n error: css`\n color: ${themeGet(\"colors.black100\")};\n border-color: ${themeGet(\"colors.red100\")};\n `,\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,IAAME,aAAa,GAAG;EAC3BC,OAAO,MAAEC,qBAAG,gEAEG,IAAAC,kBAAQ,EAAC,0BAA0B,CAAC,EACxC,IAAAA,kBAAQ,EAAC,iBAAiB,CAAC,EACpB,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAC3C;EACDC,KAAK,MAAEF,qBAAG,+DACC,IAAAC,kBAAQ,EAAC,gBAAgB,CAAC,EACnB,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAE3C;EACDE,KAAK,MAAEH,qBAAG,+DACC,IAAAC,kBAAQ,EAAC,gBAAgB,CAAC,EACnB,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAE3C;EACDG,QAAQ,MAAEJ,qBAAG,0DACF,IAAAC,kBAAQ,EAAC,gBAAgB,CAAC,EACnB,IAAAA,kBAAQ,EAAC,gBAAgB,CAAC,CAE3C;EACDI,KAAK,MAAEL,qBAAG,qCACC,IAAAC,kBAAQ,EAAC,iBAAiB,CAAC,EACpB,IAAAA,kBAAQ,EAAC,eAAe,CAAC;AAE7C,CAAC;AAAAK,OAAA,CAAAR,aAAA,GAAAA,aAAA"}
1
+ {"version":3,"file":"tokens.js","names":["_themeGet","require","_styledComponents","SELECT_STATES","default","css","themeGet","focus","hover","completed","disabled","error","exports"],"sources":["../../../src/elements/Select/tokens.ts"],"sourcesContent":["import { themeGet } from \"@styled-system/theme-get\"\nimport { css } from \"styled-components\"\nimport { State } from \"./types\"\n\nexport const SELECT_STATES: Record<State, any> = {\n default: css`\n height: 50px;\n font-size: ${themeGet(\"textVariants.sm-display.fontSize\")};\n color: ${themeGet(\"colors.black100\")};\n border-color: ${themeGet(\"colors.black30\")};\n\n + label {\n color: ${themeGet(\"colors.black60\")};\n font-size: ${themeGet(\"textVariants.sm-display.fontSize\")};\n }\n\n &:not(:has(option[value=\"\"]:checked)) + label {\n transform: translateY(-150%);\n font-size: ${themeGet(\"textVariants.xs.fontSize\")};\n }\n `,\n focus: css`\n color: ${themeGet(\"colors.black100\")};\n border-color: ${themeGet(\"colors.blue100\")};\n text-decoration: underline;\n\n + label {\n color: ${themeGet(\"colors.blue100\")};\n transform: translateY(-150%);\n font-size: ${themeGet(\"textVariants.xs.fontSize\")};\n }\n\n &:has(option[value=\"\"]:checked) + label {\n text-decoration: underline;\n }\n `,\n hover: css`\n color: ${themeGet(\"colors.blue100\")};\n border-color: ${themeGet(\"colors.black60\")};\n text-decoration: underline;\n\n + label {\n color: ${themeGet(\"colors.black60\")};\n }\n\n &:has(option[value=\"\"]:checked):not(:disabled) + label {\n color: ${themeGet(\"colors.blue100\")};\n text-decoration: underline;\n }\n `,\n completed: css`\n border-color: ${themeGet(\"colors.black60\")};\n text-decoration: none;\n\n + label {\n color: ${themeGet(\"colors.black60\")};\n }\n\n &:not(:has(option[value=\"\"]:checked)) + label {\n transform: translateY(-150%);\n font-size: ${themeGet(\"textVariants.xs.fontSize\")};\n }\n `,\n disabled: css`\n color: ${themeGet(\"colors.black30\")};\n border-color: ${themeGet(\"colors.black30\")};\n text-decoration: none;\n\n + label {\n color: ${themeGet(\"colors.black30\")};\n text-decoration: none;\n }\n\n &:not(:has(option[value=\"\"]:checked)) + label {\n transform: translateY(-150%);\n font-size: ${themeGet(\"textVariants.xs.fontSize\")};\n }\n `,\n error: css`\n color: ${themeGet(\"colors.black100\")};\n border-color: ${themeGet(\"colors.red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DK,KAAK,MAAEN,qBAAG,yDACC,IAAAC,kBAAQ,EAAC,iBAAiB,CAAC,EACpB,IAAAA,kBAAQ,EAAC,eAAe,CAAC,EAG9B,IAAAA,kBAAQ,EAAC,eAAe,CAAC;AAGxC,CAAC;AAAAM,OAAA,CAAAT,aAAA,GAAAA,aAAA"}
@@ -1,2 +1 @@
1
- export declare type Variant = "default" | "inline";
2
- export declare type State = "default" | "focus" | "hover" | "disabled" | "error";
1
+ export declare type State = "default" | "focus" | "hover" | "disabled" | "error" | "completed";
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/Select/types.ts"],"sourcesContent":["export type Variant = \"default\" | \"inline\"\nexport type State = \"default\" | \"focus\" | \"hover\" | \"disabled\" | \"error\"\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/Select/types.ts"],"sourcesContent":["export type State =\n | \"default\"\n | \"focus\"\n | \"hover\"\n | \"disabled\"\n | \"error\"\n | \"completed\"\n"],"mappings":""}
@@ -6,7 +6,7 @@ export interface TextAreaProps extends BoxProps, Omit<React.TextareaHTMLAttribut
6
6
  defaultValue?: string;
7
7
  description?: React.ReactNode;
8
8
  required?: boolean;
9
- title?: React.ReactNode;
9
+ title?: string;
10
10
  disabled?: boolean;
11
11
  error?: string | boolean;
12
12
  focus?: boolean;
@@ -8,9 +8,10 @@ exports.TextArea = void 0;
8
8
  var _themeGet = require("@styled-system/theme-get");
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
+ var _RequiredField = require("../../shared/RequiredField");
11
12
  var _Box = require("../Box");
12
- var _Spacer = require("../Spacer");
13
- var _Text = require("../Text/Text");
13
+ var _Text = require("../Text");
14
+ var _Tooltip = require("../Tooltip");
14
15
  var _tokens = require("./tokens");
15
16
  var _excluded = ["error", "disabled", "focus", "hover", "characterLimit", "title", "description", "defaultValue", "required", "onChange"];
16
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -62,17 +63,15 @@ var TextArea = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
62
63
  }, [characterLimitExceeded, error, value]);
63
64
  return /*#__PURE__*/_react.default.createElement(_Box.Box, _extends({
64
65
  width: "100%"
65
- }, boxProps), (title || description) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, title && /*#__PURE__*/_react.default.createElement(_Text.Text, {
66
- variant: "xs"
67
- }, title, required && /*#__PURE__*/_react.default.createElement(_Box.Box, {
68
- as: "span",
69
- color: "brand"
70
- }, "*")), description && /*#__PURE__*/_react.default.createElement(_Text.Text, {
66
+ }, boxProps), !!description && /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
67
+ pointer: true,
68
+ content: description,
69
+ placement: "top-end"
70
+ }, /*#__PURE__*/_react.default.createElement(_Text.Text, {
71
71
  variant: "xs",
72
- color: "black60"
73
- }, description)), /*#__PURE__*/_react.default.createElement(_Spacer.Spacer, {
74
- y: 0.5
75
- })), /*#__PURE__*/_react.default.createElement(_Box.Box, {
72
+ color: "black60",
73
+ textAlign: "right"
74
+ }, /*#__PURE__*/_react.default.createElement("u", null, "What is this?"))), /*#__PURE__*/_react.default.createElement(_Box.Box, {
76
75
  position: "relative"
77
76
  }, /*#__PURE__*/_react.default.createElement(StyledTextArea, _extends({
78
77
  ref: ref,
@@ -82,22 +81,27 @@ var TextArea = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
82
81
  error: hasError,
83
82
  onChange: handleChange,
84
83
  defaultValue: defaultValue,
85
- required: required
86
- }, inputProps)), typeof characterLimit !== "undefined" && /*#__PURE__*/_react.default.createElement(_Text.Text, {
87
- position: "absolute",
88
- bottom: 0,
89
- left: 0,
90
- px: 1,
91
- py: 0.5,
84
+ required: required,
85
+ title: title,
86
+ placeholder: inputProps.placeholder || " "
87
+ }, inputProps)), !!title && /*#__PURE__*/_react.default.createElement(StyledLabel, {
88
+ htmlFor: inputProps.name
89
+ }, title)), (required || characterLimit) && !(error && typeof error === "string") && /*#__PURE__*/_react.default.createElement(_Box.Box, {
90
+ display: "flex",
91
+ mt: 0.5,
92
+ mx: 1
93
+ }, required && /*#__PURE__*/_react.default.createElement(_RequiredField.RequiredField, {
94
+ flex: 1
95
+ }), typeof characterLimit !== "undefined" && /*#__PURE__*/_react.default.createElement(_Text.Text, {
96
+ flex: 1,
92
97
  variant: "xs",
93
98
  color: characterLimitExceeded(value) ? "red100" : "black60",
94
- style: {
95
- pointerEvents: "none"
96
- }
97
- }, characterLimit - value.length, " characters remaining")), error && typeof error === "string" && /*#__PURE__*/_react.default.createElement(_Text.Text, {
99
+ textAlign: "right"
100
+ }, value.length, "/", characterLimit)), error && typeof error === "string" && /*#__PURE__*/_react.default.createElement(_Text.Text, {
98
101
  variant: "xs",
99
102
  color: "red100",
100
- mt: 0.5
103
+ mt: 0.5,
104
+ ml: 1
101
105
  }, error));
102
106
  });
103
107
  exports.TextArea = TextArea;
@@ -105,7 +109,11 @@ TextArea.displayName = "TextArea";
105
109
  var StyledTextArea = _styledComponents.default.textarea.withConfig({
106
110
  displayName: "TextArea__StyledTextArea",
107
111
  componentId: "tnq35k-0"
108
- })(["appearance:none;display:block;width:100%;padding:", ";resize:vertical;transition:border-color 0.25s,color 0.25s;outline:none;border:1px solid;font-family:", ";::placeholder{transition:color 0.25s;}", ""], (0, _themeGet.themeGet)("space.1"), (0, _themeGet.themeGet)("fonts.sans"), function (props) {
109
- return (0, _styledComponents.css)(["", " ", " ", " ", " ", " ", " &:hover{", "}&:focus{outline:none;", ":not(:placeholder-shown){", " ", "}}&:disabled{cursor:default;", "}"], _tokens.TEXTAREA_STATES.default, props.hover && _tokens.TEXTAREA_STATES.hover, props.focus && _tokens.TEXTAREA_STATES.focus, props.active && _tokens.TEXTAREA_STATES.active, props.disabled && _tokens.TEXTAREA_STATES.disabled, props.error && _tokens.TEXTAREA_STATES.error, _tokens.TEXTAREA_STATES.hover, _tokens.TEXTAREA_STATES.focus, _tokens.TEXTAREA_STATES.active, props.error && _tokens.TEXTAREA_STATES.error, _tokens.TEXTAREA_STATES.disabled);
112
+ })(["appearance:none;display:block;width:100%;padding:", ";resize:vertical;transition:border-color 0.25s,color 0.25s;outline:none;border:1px solid;border-radius:3px;font-family:", ";::placeholder{transition:color 0.25s,opacity 0.25s;}&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus{-webkit-box-shadow:0 0 0px 1000px ", " inset;}", ""], (0, _themeGet.themeGet)("space.1"), (0, _themeGet.themeGet)("fonts.sans"), (0, _themeGet.themeGet)("colors.white100"), function (props) {
113
+ return (0, _styledComponents.css)(["", " ", " ", " ", " ", " ", " &:hover{", "}&:not(:placeholder-shown){", " ", "}&:focus{outline:none;", ":not(:placeholder-shown){", " ", "}}&:disabled{cursor:default;", "}", ""], _tokens.TEXTAREA_STATES.default, props.hover && _tokens.TEXTAREA_STATES.hover, props.focus && _tokens.TEXTAREA_STATES.focus, props.active && _tokens.TEXTAREA_STATES.active, props.disabled && _tokens.TEXTAREA_STATES.disabled, props.error && _tokens.TEXTAREA_STATES.error, _tokens.TEXTAREA_STATES.hover, _tokens.TEXTAREA_STATES.completed, props.error && _tokens.TEXTAREA_STATES.error, _tokens.TEXTAREA_STATES.focus, !!props.placeholder && _tokens.TEXTAREA_STATES.active, props.error && _tokens.TEXTAREA_STATES.error, _tokens.TEXTAREA_STATES.disabled, props.title && (0, _styledComponents.css)(["::placeholder{opacity:0;}"]));
110
114
  });
115
+ var StyledLabel = _styledComponents.default.label.withConfig({
116
+ displayName: "TextArea__StyledLabel",
117
+ componentId: "tnq35k-1"
118
+ })(["position:absolute;top:24px;left:6px;padding:0 5px;background-color:", ";transform:translateY(-50%);transition:0.25s cubic-bezier(0.64,0.05,0.36,1);transition-property:color,transform,padding,font-size;font-family:", ";pointer-events:none;"], (0, _themeGet.themeGet)("colors.white100"), (0, _themeGet.themeGet)("fonts.sans"));
111
119
  //# sourceMappingURL=TextArea.js.map