@react-spectrum/s2
Version:
Spectrum 2 UI components in React
1 lines • 4.31 kB
Source Map (JSON)
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAWM,SAAS,0CAAK,EAAU;IAC7B,OAAO,CAAC,CAAC,EAAE,CAAA,GAAA,8BAAW,EAAE,IAAI,CAAC,CAAC;AAChC;AAEO,SAAS,0CAAM,EAAU;IAC9B,OAAO,CAAC,CAAC,EAAE,CAAA,GAAA,+BAAY,EAAE,IAAI,CAAC,CAAC;AACjC;AAEO,SAAS,0CAAa,IAAY,EAAE,YAAqB;IAC9D,OAAO,CAAC,CAAC,EAAE,CAAA,GAAA,sCAAmB,EAAE,MAAM,cAAc,CAAC,CAAC;AACxD;AAEO,MAAM,4CAAY,IAAO,CAAA;QAC9B,cAAc;YACZ,SAAS;YACT,gBAAgB;QAClB;QACA,cAAc;QACd,cAAc;QACd,eAAe;IACjB,CAAA;AAgCA,MAAM,kCAAY;IAChB,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;AACN;AAEO,SAAS,0CAAqC,OAAkB;IACrE,IAAI,QAAC,OAAO,YAAK,KAAK,EAAE,GAAG,QAAO,GAAG;IAErC,IAAI,OACF,MAAM,CAAC,gBAAgB,GAAG;QACxB,MAAM;QACN,OAAO;IACT;IAGF,MAAM,CAAC,OAAO,GAAG,+BAAS,CAAC,KAAK;IAEhC,aAAa;IACb,OAAO,CAAA,GAAA,+BAAI,EAAE,IAAI,CAAC,IAAI,EAAE;AAC1B","sources":["packages/@react-spectrum/s2/style/index.ts"],"sourcesContent":["/*\n * Copyright 2024 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 type * as CSS from 'csstype';\nimport {Inset, fontRelative as internalFontRelative, size as internalSize, space as internalSpace, Spacing, style} from './spectrum-theme';\nimport type {MacroContext} from '@parcel/macros';\nimport {StyleString} from './types';\n\nexport {baseColor, color, edgeToText, lightDark, linearGradient, colorMix, style} from './spectrum-theme';\nexport type {StyleString} from './types';\n\n// Wrap these functions in arbitrary value syntax when called from the outside.\nexport function size(px: number): `[${string}]` {\n return `[${internalSize(px)}]`;\n}\n\nexport function space(px: number): `[${string}]` {\n return `[${internalSpace(px)}]`;\n}\n\nexport function fontRelative(base: number, baseFontSize?: number): `[${string}]` {\n return `[${internalFontRelative(base, baseFontSize)}]`;\n}\n\nexport const focusRing = () => ({\n outlineStyle: {\n default: 'none',\n isFocusVisible: 'solid'\n },\n outlineColor: 'focus-ring',\n outlineWidth: 2,\n outlineOffset: 2\n} as const);\n\ninterface IconStyle {\n size?: 'XS' | 'S' | 'M' | 'L' |'XL',\n color?: 'white' | 'black' | 'accent' | 'neutral' | 'negative' | 'informative' | 'positive' | 'notice' | 'gray' | 'red' | 'orange' | 'yellow' | 'chartreuse' | 'celery' | 'green' | 'seafoam' | 'cyan' | 'blue' | 'indigo' | 'purple' | 'fuchsia' | 'magenta' | 'pink' | 'turquoise' | 'cinnamon' | 'brown' | 'silver',\n margin?: Spacing,\n marginStart?: Spacing,\n marginEnd?: Spacing,\n marginTop?: Spacing,\n marginBottom?: Spacing,\n marginX?: Spacing,\n marginY?: Spacing,\n alignSelf?: 'auto' | 'start' | 'end' | 'center' | 'stretch' | 'baseline',\n justifySelf?: 'auto' | 'start' | 'end' | 'center' | 'stretch',\n order?: number,\n gridArea?: CSS.Property.GridArea,\n gridColumnStart?: CSS.Property.GridColumnStart,\n gridColumnEnd?: CSS.Property.GridColumnEnd,\n gridRowStart?: CSS.Property.GridRowStart,\n gridRowEnd?: CSS.Property.GridRowStart,\n position?: 'absolute' | 'fixed' | 'relative' | 'sticky' | 'static',\n zIndex?: number,\n top?: Inset,\n bottom?: Inset,\n inset?: Inset,\n insetX?: Inset,\n insetY?: Inset,\n insetStart?: Inset,\n insetEnd?: Inset,\n rotate?: number | `${number}deg` | `${number}rad` | `${number}grad` | `${number}turn`\n}\n\nconst iconSizes = {\n XS: 14,\n S: 16,\n M: 20,\n L: 22,\n XL: 26\n} as const;\n\nexport function iconStyle(this: MacroContext | void, options: IconStyle): StyleString<Exclude<keyof IconStyle, 'color' | 'size'>> {\n let {size = 'M', color, ...styles} = options;\n \n if (color) {\n styles['--iconPrimary'] = {\n type: 'fill',\n value: color\n };\n }\n\n styles['size'] = iconSizes[size];\n\n // @ts-ignore\n return style.call(this, styles);\n}\n"],"names":[],"version":3,"file":"main.cjs.map","sourceRoot":"../../../../../"}