@jakubmazanec/ui 0.1.0-unstable.081bdf1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/build/components/Button.d.ts +40 -0
- package/build/components/Button.js +139 -0
- package/build/components/Button.js.map +7 -0
- package/build/components/Card.d.ts +19 -0
- package/build/components/Card.js +26 -0
- package/build/components/Card.js.map +7 -0
- package/build/components/Checkbox.d.ts +39 -0
- package/build/components/Checkbox.js +87 -0
- package/build/components/Checkbox.js.map +7 -0
- package/build/components/CheckboxField.d.ts +18 -0
- package/build/components/CheckboxField.js +22 -0
- package/build/components/CheckboxField.js.map +7 -0
- package/build/components/Combobox.d.ts +57 -0
- package/build/components/Combobox.js +178 -0
- package/build/components/Combobox.js.map +7 -0
- package/build/components/ComboboxOption.d.ts +33 -0
- package/build/components/ComboboxOption.js +59 -0
- package/build/components/ComboboxOption.js.map +7 -0
- package/build/components/DataTable.d.ts +70 -0
- package/build/components/DataTable.js +383 -0
- package/build/components/DataTable.js.map +7 -0
- package/build/components/Description.d.ts +19 -0
- package/build/components/Description.js +28 -0
- package/build/components/Description.js.map +7 -0
- package/build/components/Dialog.d.ts +32 -0
- package/build/components/Dialog.js +55 -0
- package/build/components/Dialog.js.map +7 -0
- package/build/components/DialogPanel.d.ts +19 -0
- package/build/components/DialogPanel.js +29 -0
- package/build/components/DialogPanel.js.map +7 -0
- package/build/components/DialogTitle.d.ts +19 -0
- package/build/components/DialogTitle.js +28 -0
- package/build/components/DialogTitle.js.map +7 -0
- package/build/components/Error.d.ts +19 -0
- package/build/components/Error.js +37 -0
- package/build/components/Error.js.map +7 -0
- package/build/components/Field.d.ts +22 -0
- package/build/components/Field.js +32 -0
- package/build/components/Field.js.map +7 -0
- package/build/components/Fieldset.d.ts +27 -0
- package/build/components/Fieldset.js +39 -0
- package/build/components/Fieldset.js.map +7 -0
- package/build/components/Form.d.ts +22 -0
- package/build/components/Form.js +41 -0
- package/build/components/Form.js.map +7 -0
- package/build/components/Icon.d.ts +29 -0
- package/build/components/Icon.js +59 -0
- package/build/components/Icon.js.map +7 -0
- package/build/components/Input.d.ts +37 -0
- package/build/components/Input.js +111 -0
- package/build/components/Input.js.map +7 -0
- package/build/components/Label.d.ts +19 -0
- package/build/components/Label.js +26 -0
- package/build/components/Label.js.map +7 -0
- package/build/components/Legend.d.ts +19 -0
- package/build/components/Legend.js +26 -0
- package/build/components/Legend.js.map +7 -0
- package/build/components/Listbox.d.ts +59 -0
- package/build/components/Listbox.js +254 -0
- package/build/components/Listbox.js.map +7 -0
- package/build/components/ListboxOption.d.ts +33 -0
- package/build/components/ListboxOption.js +59 -0
- package/build/components/ListboxOption.js.map +7 -0
- package/build/components/Menu.d.ts +21 -0
- package/build/components/Menu.js +29 -0
- package/build/components/Menu.js.map +7 -0
- package/build/components/MenuButton.d.ts +27 -0
- package/build/components/MenuButton.js +45 -0
- package/build/components/MenuButton.js.map +7 -0
- package/build/components/MenuHeading.d.ts +19 -0
- package/build/components/MenuHeading.js +28 -0
- package/build/components/MenuHeading.js.map +7 -0
- package/build/components/MenuItem.d.ts +27 -0
- package/build/components/MenuItem.js +39 -0
- package/build/components/MenuItem.js.map +7 -0
- package/build/components/MenuItems.d.ts +22 -0
- package/build/components/MenuItems.js +36 -0
- package/build/components/MenuItems.js.map +7 -0
- package/build/components/MenuSection.d.ts +19 -0
- package/build/components/MenuSection.js +28 -0
- package/build/components/MenuSection.js.map +7 -0
- package/build/components/MenuSeparator.d.ts +19 -0
- package/build/components/MenuSeparator.js +28 -0
- package/build/components/MenuSeparator.js.map +7 -0
- package/build/components/Popover.d.ts +19 -0
- package/build/components/Popover.js +28 -0
- package/build/components/Popover.js.map +7 -0
- package/build/components/PopoverBackdrop.d.ts +19 -0
- package/build/components/PopoverBackdrop.js +28 -0
- package/build/components/PopoverBackdrop.js.map +7 -0
- package/build/components/PopoverButton.d.ts +29 -0
- package/build/components/PopoverButton.js +47 -0
- package/build/components/PopoverButton.js.map +7 -0
- package/build/components/PopoverGroup.d.ts +19 -0
- package/build/components/PopoverGroup.js +28 -0
- package/build/components/PopoverGroup.js.map +7 -0
- package/build/components/PopoverPanel.d.ts +24 -0
- package/build/components/PopoverPanel.js +38 -0
- package/build/components/PopoverPanel.js.map +7 -0
- package/build/components/Radio.d.ts +33 -0
- package/build/components/Radio.js +57 -0
- package/build/components/Radio.js.map +7 -0
- package/build/components/RadioField.d.ts +11 -0
- package/build/components/RadioField.js +15 -0
- package/build/components/RadioField.js.map +7 -0
- package/build/components/RadioGroup.d.ts +34 -0
- package/build/components/RadioGroup.js +87 -0
- package/build/components/RadioGroup.js.map +7 -0
- package/build/components/Spinner.d.ts +21 -0
- package/build/components/Spinner.js +70 -0
- package/build/components/Spinner.js.map +7 -0
- package/build/components/Table.d.ts +19 -0
- package/build/components/Table.js +26 -0
- package/build/components/Table.js.map +7 -0
- package/build/components/TableBody.d.ts +19 -0
- package/build/components/TableBody.js +26 -0
- package/build/components/TableBody.js.map +7 -0
- package/build/components/TableCaption.d.ts +19 -0
- package/build/components/TableCaption.js +31 -0
- package/build/components/TableCaption.js.map +7 -0
- package/build/components/TableCell.d.ts +19 -0
- package/build/components/TableCell.js +26 -0
- package/build/components/TableCell.js.map +7 -0
- package/build/components/TableFoot.d.ts +19 -0
- package/build/components/TableFoot.js +26 -0
- package/build/components/TableFoot.js.map +7 -0
- package/build/components/TableHead.d.ts +19 -0
- package/build/components/TableHead.js +26 -0
- package/build/components/TableHead.js.map +7 -0
- package/build/components/TableHeader.d.ts +19 -0
- package/build/components/TableHeader.js +26 -0
- package/build/components/TableHeader.js.map +7 -0
- package/build/components/TableRow.d.ts +19 -0
- package/build/components/TableRow.js +26 -0
- package/build/components/TableRow.js.map +7 -0
- package/build/components/Text.d.ts +19 -0
- package/build/components/Text.js +26 -0
- package/build/components/Text.js.map +7 -0
- package/build/components/Textarea.d.ts +34 -0
- package/build/components/Textarea.js +78 -0
- package/build/components/Textarea.js.map +7 -0
- package/build/components/data-table/DataTableHeader.d.ts +13 -0
- package/build/components/data-table/DataTableHeader.js +418 -0
- package/build/components/data-table/DataTableHeader.js.map +7 -0
- package/build/components/data-table/DataTablePageButton.d.ts +6 -0
- package/build/components/data-table/DataTablePageButton.js +11 -0
- package/build/components/data-table/DataTablePageButton.js.map +7 -0
- package/build/components/data-table/internals/constants.d.ts +3 -0
- package/build/components/data-table/internals/constants.js +5 -0
- package/build/components/data-table/internals/constants.js.map +7 -0
- package/build/components/data-table/internals/getCommonPinningClasses.d.ts +2 -0
- package/build/components/data-table/internals/getCommonPinningClasses.js +13 -0
- package/build/components/data-table/internals/getCommonPinningClasses.js.map +7 -0
- package/build/components/data-table/internals/getCommonPinningStyles.d.ts +3 -0
- package/build/components/data-table/internals/getCommonPinningStyles.js +10 -0
- package/build/components/data-table/internals/getCommonPinningStyles.js.map +7 -0
- package/build/components/internals/fieldContext.d.ts +3 -0
- package/build/components/internals/fieldContext.js +4 -0
- package/build/components/internals/fieldContext.js.map +7 -0
- package/build/components/internals/fieldNameContext.d.ts +3 -0
- package/build/components/internals/fieldNameContext.js +4 -0
- package/build/components/internals/fieldNameContext.js.map +7 -0
- package/build/components/internals/filterProps.d.ts +4 -0
- package/build/components/internals/filterProps.js +9 -0
- package/build/components/internals/filterProps.js.map +7 -0
- package/build/components/internals/formIdContext.d.ts +2 -0
- package/build/components/internals/formIdContext.js +4 -0
- package/build/components/internals/formIdContext.js.map +7 -0
- package/build/components/internals/forwardRef.d.ts +4 -0
- package/build/components/internals/forwardRef.js +6 -0
- package/build/components/internals/forwardRef.js.map +7 -0
- package/build/components/internals/useFormId.d.ts +1 -0
- package/build/components/internals/useFormId.js +7 -0
- package/build/components/internals/useFormId.js.map +7 -0
- package/build/components/internals.d.ts +6 -0
- package/build/components/internals.js +8 -0
- package/build/components/internals.js.map +7 -0
- package/build/components/useField.d.ts +1 -0
- package/build/components/useField.js +7 -0
- package/build/components/useField.js.map +7 -0
- package/build/components/useFieldName.d.ts +1 -0
- package/build/components/useFieldName.js +7 -0
- package/build/components/useFieldName.js.map +7 -0
- package/build/components/useForm.d.ts +10 -0
- package/build/components/useForm.js +19 -0
- package/build/components/useForm.js.map +7 -0
- package/build/components.d.ts +50 -0
- package/build/components.js +52 -0
- package/build/components.js.map +7 -0
- package/build/development/createTailwindConfig.d.ts +18 -0
- package/build/development/createTailwindConfig.js +161 -0
- package/build/development/createTailwindConfig.js.map +7 -0
- package/build/development/createTailwindMerge.d.ts +2 -0
- package/build/development/createTailwindMerge.js +74 -0
- package/build/development/createTailwindMerge.js.map +7 -0
- package/build/development/internals/PaletteConfig.d.ts +6 -0
- package/build/development/internals/PaletteConfig.js +2 -0
- package/build/development/internals/PaletteConfig.js.map +7 -0
- package/build/development/internals/SwatchValue.d.ts +9 -0
- package/build/development/internals/SwatchValue.js +2 -0
- package/build/development/internals/SwatchValue.js.map +7 -0
- package/build/development/internals/clamp.d.ts +1 -0
- package/build/development/internals/clamp.js +5 -0
- package/build/development/internals/clamp.js.map +7 -0
- package/build/development/internals/constants.d.ts +2 -0
- package/build/development/internals/constants.js +22 -0
- package/build/development/internals/constants.js.map +7 -0
- package/build/development/internals/createDisplayColor.d.ts +1 -0
- package/build/development/internals/createDisplayColor.js +24 -0
- package/build/development/internals/createDisplayColor.js.map +7 -0
- package/build/development/internals/createDistributionValues.d.ts +4 -0
- package/build/development/internals/createDistributionValues.js +32 -0
- package/build/development/internals/createDistributionValues.js.map +7 -0
- package/build/development/internals/createHueScale.d.ts +4 -0
- package/build/development/internals/createHueScale.js +15 -0
- package/build/development/internals/createHueScale.js.map +7 -0
- package/build/development/internals/createPalette.d.ts +16 -0
- package/build/development/internals/createPalette.js +36 -0
- package/build/development/internals/createPalette.js.map +7 -0
- package/build/development/internals/createSaturationScale.d.ts +4 -0
- package/build/development/internals/createSaturationScale.js +18 -0
- package/build/development/internals/createSaturationScale.js.map +7 -0
- package/build/development/internals/createSwatches.d.ts +10 -0
- package/build/development/internals/createSwatches.js +31 -0
- package/build/development/internals/createSwatches.js.map +7 -0
- package/build/development/internals/hexToHsl.d.ts +5 -0
- package/build/development/internals/hexToHsl.js +37 -0
- package/build/development/internals/hexToHsl.js.map +7 -0
- package/build/development/internals/hexToRgb.d.ts +5 -0
- package/build/development/internals/hexToRgb.js +21 -0
- package/build/development/internals/hexToRgb.js.map +7 -0
- package/build/development/internals/hslToHex.d.ts +1 -0
- package/build/development/internals/hslToHex.js +19 -0
- package/build/development/internals/hslToHex.js.map +7 -0
- package/build/development/internals/hslToRgb.d.ts +5 -0
- package/build/development/internals/hslToRgb.js +42 -0
- package/build/development/internals/hslToRgb.js.map +7 -0
- package/build/development/internals/isHex.d.ts +1 -0
- package/build/development/internals/isHex.js +7 -0
- package/build/development/internals/isHex.js.map +7 -0
- package/build/development/internals/resolveModule.d.ts +1 -0
- package/build/development/internals/resolveModule.js +9 -0
- package/build/development/internals/resolveModule.js.map +7 -0
- package/build/development/internals/round.d.ts +1 -0
- package/build/development/internals/round.js +6 -0
- package/build/development/internals/round.js.map +7 -0
- package/build/development/internals/unsignedModulo.d.ts +1 -0
- package/build/development/internals/unsignedModulo.js +5 -0
- package/build/development/internals/unsignedModulo.js.map +7 -0
- package/build/development/internals.d.ts +1 -0
- package/build/development/internals.js +3 -0
- package/build/development/internals.js.map +7 -0
- package/build/development.d.ts +2 -0
- package/build/development.js +4 -0
- package/build/development.js.map +7 -0
- package/build/inter-variable-italic.woff2 +0 -0
- package/build/inter-variable.woff2 +0 -0
- package/build/main.d.ts +5 -0
- package/build/main.js +7 -0
- package/build/main.js.map +7 -0
- package/build/styles.css +23 -0
- package/build/styles.css.map +7 -0
- package/build/theme/Theme.d.ts +143 -0
- package/build/theme/Theme.js +2 -0
- package/build/theme/Theme.js.map +7 -0
- package/build/theme/ThemeProvider.d.ts +6 -0
- package/build/theme/ThemeProvider.js +7 -0
- package/build/theme/ThemeProvider.js.map +7 -0
- package/build/theme/defaultTheme.d.ts +2 -0
- package/build/theme/defaultTheme.js +100 -0
- package/build/theme/defaultTheme.js.map +7 -0
- package/build/theme/internals/ClassName.d.ts +1 -0
- package/build/theme/internals/ClassName.js +2 -0
- package/build/theme/internals/ClassName.js.map +7 -0
- package/build/theme/internals/ComponentProps.d.ts +7 -0
- package/build/theme/internals/ComponentProps.js +2 -0
- package/build/theme/internals/ComponentProps.js.map +7 -0
- package/build/theme/internals/ComponentTheme.d.ts +35 -0
- package/build/theme/internals/ComponentTheme.js +2 -0
- package/build/theme/internals/ComponentTheme.js.map +7 -0
- package/build/theme/internals/ComponentThemeCompoundVariants.d.ts +12 -0
- package/build/theme/internals/ComponentThemeCompoundVariants.js +2 -0
- package/build/theme/internals/ComponentThemeCompoundVariants.js.map +7 -0
- package/build/theme/internals/ComponentThemeDefinition.d.ts +6 -0
- package/build/theme/internals/ComponentThemeDefinition.js +2 -0
- package/build/theme/internals/ComponentThemeDefinition.js.map +7 -0
- package/build/theme/internals/ComponentThemeDefinitionElements.d.ts +1 -0
- package/build/theme/internals/ComponentThemeDefinitionElements.js +2 -0
- package/build/theme/internals/ComponentThemeDefinitionElements.js.map +7 -0
- package/build/theme/internals/ComponentThemeDefinitionVariants.d.ts +3 -0
- package/build/theme/internals/ComponentThemeDefinitionVariants.js +2 -0
- package/build/theme/internals/ComponentThemeDefinitionVariants.js.map +7 -0
- package/build/theme/internals/ComponentThemeProps.d.ts +5 -0
- package/build/theme/internals/ComponentThemeProps.js +2 -0
- package/build/theme/internals/ComponentThemeProps.js.map +7 -0
- package/build/theme/internals/ComponentThemeVariants.d.ts +14 -0
- package/build/theme/internals/ComponentThemeVariants.js +2 -0
- package/build/theme/internals/ComponentThemeVariants.js.map +7 -0
- package/build/theme/internals/ComponentWithTheme.d.ts +5 -0
- package/build/theme/internals/ComponentWithTheme.js +2 -0
- package/build/theme/internals/ComponentWithTheme.js.map +7 -0
- package/build/theme/internals/UseComponentTheme.d.ts +21 -0
- package/build/theme/internals/UseComponentTheme.js +2 -0
- package/build/theme/internals/UseComponentTheme.js.map +7 -0
- package/build/theme/internals/UseComponentThemeReturn.d.ts +6 -0
- package/build/theme/internals/UseComponentThemeReturn.js +2 -0
- package/build/theme/internals/UseComponentThemeReturn.js.map +7 -0
- package/build/theme/internals/booleanToString.d.ts +1 -0
- package/build/theme/internals/booleanToString.js +5 -0
- package/build/theme/internals/booleanToString.js.map +7 -0
- package/build/theme/internals/createComponentTheme.d.ts +3 -0
- package/build/theme/internals/createComponentTheme.js +39 -0
- package/build/theme/internals/createComponentTheme.js.map +7 -0
- package/build/theme/internals/createUseComponentThemeReturn.d.ts +15 -0
- package/build/theme/internals/createUseComponentThemeReturn.js +50 -0
- package/build/theme/internals/createUseComponentThemeReturn.js.map +7 -0
- package/build/theme/internals/pickPropertyIfExists.d.ts +4 -0
- package/build/theme/internals/pickPropertyIfExists.js +11 -0
- package/build/theme/internals/pickPropertyIfExists.js.map +7 -0
- package/build/theme/internals/themeContext.d.ts +330 -0
- package/build/theme/internals/themeContext.js +4 -0
- package/build/theme/internals/themeContext.js.map +7 -0
- package/build/theme/internals/useTheme.d.ts +329 -0
- package/build/theme/internals/useTheme.js +7 -0
- package/build/theme/internals/useTheme.js.map +7 -0
- package/build/theme/internals.d.ts +18 -0
- package/build/theme/internals.js +20 -0
- package/build/theme/internals.js.map +7 -0
- package/build/theme.d.ts +3 -0
- package/build/theme.js +5 -0
- package/build/theme.js.map +7 -0
- package/build/utilities/WithLocaleOrLocales.d.ts +5 -0
- package/build/utilities/WithLocaleOrLocales.js +2 -0
- package/build/utilities/WithLocaleOrLocales.js.map +7 -0
- package/build/utilities/formatDateTime.d.ts +3 -0
- package/build/utilities/formatDateTime.js +11 -0
- package/build/utilities/formatDateTime.js.map +7 -0
- package/build/utilities/formatNumber.d.ts +3 -0
- package/build/utilities/formatNumber.js +11 -0
- package/build/utilities/formatNumber.js.map +7 -0
- package/build/utilities/internals/cache.d.ts +1 -0
- package/build/utilities/internals/cache.js +3 -0
- package/build/utilities/internals/cache.js.map +7 -0
- package/build/utilities/internals/createCacheKey.d.ts +1 -0
- package/build/utilities/internals/createCacheKey.js +6 -0
- package/build/utilities/internals/createCacheKey.js.map +7 -0
- package/build/utilities/internals/getMemoized.d.ts +1 -0
- package/build/utilities/internals/getMemoized.js +12 -0
- package/build/utilities/internals/getMemoized.js.map +7 -0
- package/build/utilities/internals/normalizeLocales.d.ts +2 -0
- package/build/utilities/internals/normalizeLocales.js +12 -0
- package/build/utilities/internals/normalizeLocales.js.map +7 -0
- package/build/utilities/internals.d.ts +4 -0
- package/build/utilities/internals.js +6 -0
- package/build/utilities/internals.js.map +7 -0
- package/build/utilities.d.ts +3 -0
- package/build/utilities.js +5 -0
- package/build/utilities.js.map +7 -0
- package/package.json +100 -0
- package/source/components/Button.tsx +172 -0
- package/source/components/Card.ts +46 -0
- package/source/components/Checkbox.tsx +125 -0
- package/source/components/CheckboxField.tsx +61 -0
- package/source/components/Combobox.tsx +298 -0
- package/source/components/ComboboxOption.tsx +95 -0
- package/source/components/DataTable.tsx +464 -0
- package/source/components/Description.tsx +52 -0
- package/source/components/Dialog.tsx +85 -0
- package/source/components/DialogPanel.tsx +54 -0
- package/source/components/DialogTitle.tsx +52 -0
- package/source/components/Error.tsx +58 -0
- package/source/components/Field.tsx +79 -0
- package/source/components/Fieldset.tsx +64 -0
- package/source/components/Form.tsx +72 -0
- package/source/components/Icon.tsx +96 -0
- package/source/components/Input.tsx +156 -0
- package/source/components/Label.tsx +49 -0
- package/source/components/Legend.tsx +49 -0
- package/source/components/Listbox.tsx +401 -0
- package/source/components/ListboxOption.tsx +95 -0
- package/source/components/Menu.tsx +50 -0
- package/source/components/MenuButton.tsx +69 -0
- package/source/components/MenuHeading.tsx +52 -0
- package/source/components/MenuItem.tsx +63 -0
- package/source/components/MenuItems.tsx +61 -0
- package/source/components/MenuSection.tsx +52 -0
- package/source/components/MenuSeparator.tsx +52 -0
- package/source/components/Popover.tsx +52 -0
- package/source/components/PopoverBackdrop.tsx +52 -0
- package/source/components/PopoverButton.tsx +72 -0
- package/source/components/PopoverGroup.tsx +52 -0
- package/source/components/PopoverPanel.tsx +65 -0
- package/source/components/Radio.tsx +88 -0
- package/source/components/RadioField.tsx +31 -0
- package/source/components/RadioGroup.tsx +147 -0
- package/source/components/Spinner.tsx +70 -0
- package/source/components/Table.ts +47 -0
- package/source/components/TableBody.ts +47 -0
- package/source/components/TableCaption.ts +52 -0
- package/source/components/TableCell.ts +47 -0
- package/source/components/TableFoot.ts +47 -0
- package/source/components/TableHead.ts +47 -0
- package/source/components/TableHeader.ts +47 -0
- package/source/components/TableRow.ts +47 -0
- package/source/components/Text.ts +47 -0
- package/source/components/Textarea.tsx +104 -0
- package/source/components/data-table/DataTableHeader.tsx +602 -0
- package/source/components/data-table/DataTablePageButton.tsx +21 -0
- package/source/components/data-table/internals/constants.ts +3 -0
- package/source/components/data-table/internals/getCommonPinningClasses.ts +19 -0
- package/source/components/data-table/internals/getCommonPinningStyles.ts +13 -0
- package/source/components/internals/fieldContext.ts +4 -0
- package/source/components/internals/fieldNameContext.ts +5 -0
- package/source/components/internals/filterProps.ts +12 -0
- package/source/components/internals/formIdContext.ts +3 -0
- package/source/components/internals/forwardRef.ts +7 -0
- package/source/components/internals/useFormId.ts +7 -0
- package/source/components/internals.ts +6 -0
- package/source/components/useField.ts +7 -0
- package/source/components/useFieldName.ts +7 -0
- package/source/components/useForm.ts +24 -0
- package/source/components.ts +50 -0
- package/source/development/createTailwindConfig.ts +182 -0
- package/source/development/createTailwindMerge.ts +101 -0
- package/source/development/internals/PaletteConfig.ts +6 -0
- package/source/development/internals/SwatchValue.ts +9 -0
- package/source/development/internals/clamp.ts +3 -0
- package/source/development/internals/constants.ts +4 -0
- package/source/development/internals/createDisplayColor.ts +29 -0
- package/source/development/internals/createDistributionValues.ts +38 -0
- package/source/development/internals/createHueScale.ts +17 -0
- package/source/development/internals/createPalette.ts +54 -0
- package/source/development/internals/createSaturationScale.ts +21 -0
- package/source/development/internals/createSwatches.ts +34 -0
- package/source/development/internals/hexToHsl.ts +45 -0
- package/source/development/internals/hexToRgb.ts +23 -0
- package/source/development/internals/hslToHex.ts +23 -0
- package/source/development/internals/hslToRgb.ts +43 -0
- package/source/development/internals/isHex.ts +7 -0
- package/source/development/internals/resolveModule.ts +9 -0
- package/source/development/internals/round.ts +5 -0
- package/source/development/internals/unsignedModulo.ts +3 -0
- package/source/development/internals.ts +1 -0
- package/source/development.ts +2 -0
- package/source/inter-variable-italic.woff2 +0 -0
- package/source/inter-variable.woff2 +0 -0
- package/source/main.ts +5 -0
- package/source/styles.css +25 -0
- package/source/theme/Theme.ts +100 -0
- package/source/theme/ThemeProvider.tsx +12 -0
- package/source/theme/defaultTheme.ts +100 -0
- package/source/theme/internals/ClassName.ts +1 -0
- package/source/theme/internals/ComponentProps.ts +13 -0
- package/source/theme/internals/ComponentTheme.ts +50 -0
- package/source/theme/internals/ComponentThemeCompoundVariants.ts +20 -0
- package/source/theme/internals/ComponentThemeDefinition.ts +7 -0
- package/source/theme/internals/ComponentThemeDefinitionElements.ts +1 -0
- package/source/theme/internals/ComponentThemeDefinitionVariants.ts +3 -0
- package/source/theme/internals/ComponentThemeProps.ts +11 -0
- package/source/theme/internals/ComponentThemeVariants.ts +24 -0
- package/source/theme/internals/ComponentWithTheme.ts +6 -0
- package/source/theme/internals/UseComponentTheme.ts +22 -0
- package/source/theme/internals/UseComponentThemeReturn.ts +15 -0
- package/source/theme/internals/booleanToString.ts +6 -0
- package/source/theme/internals/createComponentTheme.ts +70 -0
- package/source/theme/internals/createUseComponentThemeReturn.ts +87 -0
- package/source/theme/internals/pickPropertyIfExists.ts +24 -0
- package/source/theme/internals/themeContext.ts +5 -0
- package/source/theme/internals/useTheme.ts +7 -0
- package/source/theme/internals.ts +18 -0
- package/source/theme.ts +3 -0
- package/source/utilities/WithLocaleOrLocales.ts +1 -0
- package/source/utilities/formatDateTime.ts +15 -0
- package/source/utilities/formatNumber.ts +15 -0
- package/source/utilities/internals/cache.ts +1 -0
- package/source/utilities/internals/createCacheKey.ts +9 -0
- package/source/utilities/internals/getMemoized.ts +14 -0
- package/source/utilities/internals/normalizeLocales.ts +15 -0
- package/source/utilities/internals.ts +4 -0
- package/source/utilities.ts +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function clamp(x: number, min: number, max: number): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/clamp.ts"],
|
|
4
|
+
"sourcesContent": ["export function clamp(x: number, min: number, max: number) {\n return Math.min(Math.max(x, min), max);\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,gBAAS,MAAM,GAAW,KAAa,KAAa;AACzD,SAAO,KAAK,IAAI,KAAK,IAAI,GAAG,GAAG,GAAG,GAAG;AACvC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
export const DEFAULT_STOP = 500;
|
|
3
|
+
export const DEFAULT_STOPS = [
|
|
4
|
+
0,
|
|
5
|
+
10,
|
|
6
|
+
25,
|
|
7
|
+
50,
|
|
8
|
+
100,
|
|
9
|
+
200,
|
|
10
|
+
300,
|
|
11
|
+
400,
|
|
12
|
+
500,
|
|
13
|
+
600,
|
|
14
|
+
700,
|
|
15
|
+
800,
|
|
16
|
+
900,
|
|
17
|
+
950,
|
|
18
|
+
975,
|
|
19
|
+
990,
|
|
20
|
+
1e3
|
|
21
|
+
];
|
|
22
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/constants.ts"],
|
|
4
|
+
"sourcesContent": ["export const DEFAULT_STOP = 500;\nexport const DEFAULT_STOPS = [\n 0, 10, 25, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950, 975, 990, 1000,\n] as const;\n"],
|
|
5
|
+
"mappings": ";AAAO,aAAM,eAAe;AACrB,aAAM,gBAAgB;AAAA,EAC3B;AAAA,EAAG;AAAA,EAAI;AAAA,EAAI;AAAA,EAAI;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAAA,EAAK;AAC7E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createDisplayColor(hexColor: string, alphaPlaceholder?: boolean): string | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { oklch } from "culori";
|
|
3
|
+
import { isHex } from "./isHex.js";
|
|
4
|
+
import { round } from "./round.js";
|
|
5
|
+
export function createDisplayColor(hexColor, alphaPlaceholder) {
|
|
6
|
+
if (!hexColor || !isHex(hexColor)) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
let display = null;
|
|
10
|
+
let oklchColor = oklch(hexColor);
|
|
11
|
+
if (!oklchColor) {
|
|
12
|
+
throw new Error(`Couldn't convert "${hexColor}" to OKLCH!`);
|
|
13
|
+
}
|
|
14
|
+
let { l, c, h = 0 } = oklchColor;
|
|
15
|
+
display = `oklch(${[
|
|
16
|
+
`${round(l * 100, 2)}%`,
|
|
17
|
+
round(c, 3),
|
|
18
|
+
round(h, 2),
|
|
19
|
+
`/`,
|
|
20
|
+
alphaPlaceholder ? `<alpha-value>` : 1
|
|
21
|
+
].join(` `)})`;
|
|
22
|
+
return display;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=createDisplayColor.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/createDisplayColor.ts"],
|
|
4
|
+
"sourcesContent": ["import {oklch} from 'culori';\n\nimport {isHex} from './isHex.js';\nimport {round} from './round.js';\n\nexport function createDisplayColor(hexColor: string, alphaPlaceholder?: boolean): string | null {\n if (!hexColor || !isHex(hexColor)) {\n return null;\n }\n\n let display = null;\n let oklchColor = oklch(hexColor);\n\n if (!oklchColor) {\n throw new Error(`Couldn't convert \"${hexColor}\" to OKLCH!`);\n }\n\n let {l, c, h = 0} = oklchColor;\n\n display = `oklch(${[\n `${round(l * 100, 2)}%`,\n round(c, 3),\n round(h, 2),\n `/`,\n alphaPlaceholder ? `<alpha-value>` : 1,\n ].join(` `)})`;\n\n return display;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,aAAY;AAEpB,SAAQ,aAAY;AACpB,SAAQ,aAAY;AAEb,gBAAS,mBAAmB,UAAkB,kBAA2C;AAC9F,MAAI,CAAC,YAAY,CAAC,MAAM,QAAQ,GAAG;AACjC,WAAO;AAAA,EACT;AAEA,MAAI,UAAU;AACd,MAAI,aAAa,MAAM,QAAQ;AAE/B,MAAI,CAAC,YAAY;AACf,UAAM,IAAI,MAAM,qBAAqB,QAAQ,aAAa;AAAA,EAC5D;AAEA,MAAI,EAAC,GAAG,GAAG,IAAI,EAAC,IAAI;AAEpB,YAAU,SAAS;AAAA,IACjB,GAAG,MAAM,IAAI,KAAK,CAAC,CAAC;AAAA,IACpB,MAAM,GAAG,CAAC;AAAA,IACV,MAAM,GAAG,CAAC;AAAA,IACV;AAAA,IACA,mBAAmB,kBAAkB;AAAA,EACvC,EAAE,KAAK,GAAG,CAAC;AAEX,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { DEFAULT_STOP, DEFAULT_STOPS } from "./constants.js";
|
|
3
|
+
const MIN = 0;
|
|
4
|
+
const MAX = 100;
|
|
5
|
+
export function createDistributionValues(lightness, stop = DEFAULT_STOP) {
|
|
6
|
+
let stops = [...DEFAULT_STOPS].sort();
|
|
7
|
+
let newValues = [
|
|
8
|
+
{ stop: 0, value: MAX },
|
|
9
|
+
{ stop, value: lightness },
|
|
10
|
+
{ stop: 1e3, value: MIN }
|
|
11
|
+
];
|
|
12
|
+
let stopIndex = stops.indexOf(stop);
|
|
13
|
+
let firstHalf = stops.slice(0, stopIndex + 1);
|
|
14
|
+
let secondHalf = stops.slice(stopIndex);
|
|
15
|
+
for (let stopValue of firstHalf) {
|
|
16
|
+
if (stopValue !== 0 && stopValue !== stop) {
|
|
17
|
+
let percentage = (stopValue - 0) / (stop - 0);
|
|
18
|
+
let value = MAX - percentage * (MAX - lightness);
|
|
19
|
+
newValues.push({ stop: stopValue, value: Math.round(value) });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
for (let stopValue of secondHalf) {
|
|
23
|
+
if (stopValue !== 1e3 && stopValue !== stop) {
|
|
24
|
+
let percentage = (stopValue - stop) / (1e3 - stop);
|
|
25
|
+
let value = lightness - percentage * (lightness - MIN);
|
|
26
|
+
newValues.push({ stop: stopValue, value: Math.round(value) });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
newValues.sort((a, b) => a.stop - b.stop);
|
|
30
|
+
return newValues;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=createDistributionValues.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/createDistributionValues.ts"],
|
|
4
|
+
"sourcesContent": ["import {DEFAULT_STOP, DEFAULT_STOPS} from './constants.js';\n\nconst MIN = 0;\nconst MAX = 100;\n\nexport function createDistributionValues(lightness: number, stop: number = DEFAULT_STOP) {\n let stops: number[] = [...DEFAULT_STOPS].sort() as unknown as number[];\n let newValues = [\n {stop: 0, value: MAX},\n {stop, value: lightness},\n {stop: 1000, value: MIN},\n ];\n let stopIndex = stops.indexOf(stop);\n let firstHalf = stops.slice(0, stopIndex + 1);\n let secondHalf = stops.slice(stopIndex);\n\n for (let stopValue of firstHalf) {\n if (stopValue !== 0 && stopValue !== stop) {\n let percentage = (stopValue - 0) / (stop - 0);\n let value = MAX - percentage * (MAX - lightness);\n\n newValues.push({stop: stopValue, value: Math.round(value)});\n }\n }\n\n for (let stopValue of secondHalf) {\n if (stopValue !== 1000 && stopValue !== stop) {\n let percentage = (stopValue - stop) / (1000 - stop);\n let value = lightness - percentage * (lightness - MIN);\n\n newValues.push({stop: stopValue, value: Math.round(value)});\n }\n }\n\n newValues.sort((a, b) => a.stop - b.stop);\n\n return newValues;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,cAAc,qBAAoB;AAE1C,MAAM,MAAM;AACZ,MAAM,MAAM;AAEL,gBAAS,yBAAyB,WAAmB,OAAe,cAAc;AACvF,MAAI,QAAkB,CAAC,GAAG,aAAa,EAAE,KAAK;AAC9C,MAAI,YAAY;AAAA,IACd,EAAC,MAAM,GAAG,OAAO,IAAG;AAAA,IACpB,EAAC,MAAM,OAAO,UAAS;AAAA,IACvB,EAAC,MAAM,KAAM,OAAO,IAAG;AAAA,EACzB;AACA,MAAI,YAAY,MAAM,QAAQ,IAAI;AAClC,MAAI,YAAY,MAAM,MAAM,GAAG,YAAY,CAAC;AAC5C,MAAI,aAAa,MAAM,MAAM,SAAS;AAEtC,WAAS,aAAa,WAAW;AAC/B,QAAI,cAAc,KAAK,cAAc,MAAM;AACzC,UAAI,cAAc,YAAY,MAAM,OAAO;AAC3C,UAAI,QAAQ,MAAM,cAAc,MAAM;AAEtC,gBAAU,KAAK,EAAC,MAAM,WAAW,OAAO,KAAK,MAAM,KAAK,EAAC,CAAC;AAAA,IAC5D;AAAA,EACF;AAEA,WAAS,aAAa,YAAY;AAChC,QAAI,cAAc,OAAQ,cAAc,MAAM;AAC5C,UAAI,cAAc,YAAY,SAAS,MAAO;AAC9C,UAAI,QAAQ,YAAY,cAAc,YAAY;AAElD,gBAAU,KAAK,EAAC,MAAM,WAAW,OAAO,KAAK,MAAM,KAAK,EAAC,CAAC;AAAA,IAC5D;AAAA,EACF;AAEA,YAAU,KAAK,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI;AAExC,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { DEFAULT_STOP, DEFAULT_STOPS } from "./constants.js";
|
|
3
|
+
export function createHueScale(tweak = 0, stop = DEFAULT_STOP) {
|
|
4
|
+
let stops = DEFAULT_STOPS;
|
|
5
|
+
let index = stops.indexOf(stop);
|
|
6
|
+
if (index === -1) {
|
|
7
|
+
throw new Error(`Invalid parameter value: ${stop}`);
|
|
8
|
+
}
|
|
9
|
+
return stops.map((stop2) => {
|
|
10
|
+
let diff = Math.abs(stops.indexOf(stop2) - index);
|
|
11
|
+
let tweakValue = tweak ? diff * tweak : 0;
|
|
12
|
+
return { stop: stop2, tweak: tweakValue };
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=createHueScale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/createHueScale.ts"],
|
|
4
|
+
"sourcesContent": ["import {DEFAULT_STOP, DEFAULT_STOPS} from './constants.js';\n\nexport function createHueScale(tweak = 0, stop: number = DEFAULT_STOP) {\n let stops: number[] = DEFAULT_STOPS as unknown as number[];\n let index = stops.indexOf(stop);\n\n if (index === -1) {\n throw new Error(`Invalid parameter value: ${stop}`);\n }\n\n return stops.map((stop) => {\n let diff = Math.abs(stops.indexOf(stop) - index);\n let tweakValue = tweak ? diff * tweak : 0;\n\n return {stop, tweak: tweakValue};\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,cAAc,qBAAoB;AAEnC,gBAAS,eAAe,QAAQ,GAAG,OAAe,cAAc;AACrE,MAAI,QAAkB;AACtB,MAAI,QAAQ,MAAM,QAAQ,IAAI;AAE9B,MAAI,UAAU,IAAI;AAChB,UAAM,IAAI,MAAM,4BAA4B,IAAI,EAAE;AAAA,EACpD;AAEA,SAAO,MAAM,IAAI,CAACA,UAAS;AACzB,QAAI,OAAO,KAAK,IAAI,MAAM,QAAQA,KAAI,IAAI,KAAK;AAC/C,QAAI,aAAa,QAAQ,OAAO,QAAQ;AAExC,WAAO,EAAC,MAAAA,OAAM,OAAO,WAAU;AAAA,EACjC,CAAC;AACH;",
|
|
6
|
+
"names": ["stop"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type DEFAULT_STOPS } from './constants.js';
|
|
2
|
+
export type CreatePaletteOptions<N extends string> = {
|
|
3
|
+
name: N;
|
|
4
|
+
swatches: Array<{
|
|
5
|
+
hex: string;
|
|
6
|
+
stop: number;
|
|
7
|
+
}>;
|
|
8
|
+
hueShift: number;
|
|
9
|
+
saturationShift: number;
|
|
10
|
+
};
|
|
11
|
+
export type CreatePaletteReturn<N extends string> = {
|
|
12
|
+
[K in N]: {
|
|
13
|
+
[J in (typeof DEFAULT_STOPS)[number]]: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function createPalette<const N extends string>({ name, swatches, hueShift, saturationShift, }: CreatePaletteOptions<N>): CreatePaletteReturn<N>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { DEFAULT_STOP } from "./constants.js";
|
|
3
|
+
import { createDisplayColor } from "./createDisplayColor.js";
|
|
4
|
+
import { createSwatches } from "./createSwatches.js";
|
|
5
|
+
export function createPalette({
|
|
6
|
+
name,
|
|
7
|
+
swatches,
|
|
8
|
+
hueShift,
|
|
9
|
+
saturationShift
|
|
10
|
+
}) {
|
|
11
|
+
let defaultSwatch = swatches.find((swatch) => swatch.stop === DEFAULT_STOP);
|
|
12
|
+
if (!defaultSwatch) {
|
|
13
|
+
throw new Error(`Swatches are missing color for stop "${DEFAULT_STOP}"!`);
|
|
14
|
+
}
|
|
15
|
+
let allSwatches = createSwatches({
|
|
16
|
+
value: defaultSwatch.hex,
|
|
17
|
+
valueStop: DEFAULT_STOP,
|
|
18
|
+
h: hueShift,
|
|
19
|
+
s: saturationShift
|
|
20
|
+
});
|
|
21
|
+
let palette = {};
|
|
22
|
+
allSwatches.filter((swatch) => ![0, 1e3].includes(swatch.stop)).forEach((newSwatch) => {
|
|
23
|
+
let existingSwatch = swatches.find((swatch) => swatch.stop === newSwatch.stop);
|
|
24
|
+
if (existingSwatch) {
|
|
25
|
+
Object.assign(palette, {
|
|
26
|
+
[existingSwatch.stop]: createDisplayColor(existingSwatch.hex, true)
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
Object.assign(palette, { [newSwatch.stop]: createDisplayColor(newSwatch.hex, true) });
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
[name]: palette
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=createPalette.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/createPalette.ts"],
|
|
4
|
+
"sourcesContent": ["import {DEFAULT_STOP, type DEFAULT_STOPS} from './constants.js';\nimport {createDisplayColor} from './createDisplayColor.js';\nimport {createSwatches} from './createSwatches.js';\n\nexport type CreatePaletteOptions<N extends string> = {\n name: N;\n swatches: Array<{hex: string; stop: number}>;\n hueShift: number;\n saturationShift: number;\n};\n\nexport type CreatePaletteReturn<N extends string> = {\n [K in N]: {[J in (typeof DEFAULT_STOPS)[number]]: string};\n};\n\nexport function createPalette<const N extends string>({\n name,\n swatches,\n hueShift,\n saturationShift,\n}: CreatePaletteOptions<N>): CreatePaletteReturn<N> {\n let defaultSwatch = swatches.find((swatch) => swatch.stop === DEFAULT_STOP);\n\n if (!defaultSwatch) {\n throw new Error(`Swatches are missing color for stop \"${DEFAULT_STOP}\"!`);\n }\n\n let allSwatches = createSwatches({\n value: defaultSwatch.hex,\n valueStop: DEFAULT_STOP,\n h: hueShift,\n s: saturationShift,\n });\n let palette = {};\n\n allSwatches\n .filter((swatch) => ![0, 1000].includes(swatch.stop))\n .forEach((newSwatch) => {\n let existingSwatch = swatches.find((swatch) => swatch.stop === newSwatch.stop);\n\n if (existingSwatch) {\n Object.assign(palette, {\n [existingSwatch.stop]: createDisplayColor(existingSwatch.hex, true),\n });\n } else {\n Object.assign(palette, {[newSwatch.stop]: createDisplayColor(newSwatch.hex, true)});\n }\n });\n\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- false positive\n return {\n [name]: palette,\n } as CreatePaletteReturn<N>;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,oBAAuC;AAC/C,SAAQ,0BAAyB;AACjC,SAAQ,sBAAqB;AAatB,gBAAS,cAAsC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoD;AAClD,MAAI,gBAAgB,SAAS,KAAK,CAAC,WAAW,OAAO,SAAS,YAAY;AAE1E,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI,MAAM,wCAAwC,YAAY,IAAI;AAAA,EAC1E;AAEA,MAAI,cAAc,eAAe;AAAA,IAC/B,OAAO,cAAc;AAAA,IACrB,WAAW;AAAA,IACX,GAAG;AAAA,IACH,GAAG;AAAA,EACL,CAAC;AACD,MAAI,UAAU,CAAC;AAEf,cACG,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,GAAI,EAAE,SAAS,OAAO,IAAI,CAAC,EACnD,QAAQ,CAAC,cAAc;AACtB,QAAI,iBAAiB,SAAS,KAAK,CAAC,WAAW,OAAO,SAAS,UAAU,IAAI;AAE7E,QAAI,gBAAgB;AAClB,aAAO,OAAO,SAAS;AAAA,QACrB,CAAC,eAAe,IAAI,GAAG,mBAAmB,eAAe,KAAK,IAAI;AAAA,MACpE,CAAC;AAAA,IACH,OAAO;AACL,aAAO,OAAO,SAAS,EAAC,CAAC,UAAU,IAAI,GAAG,mBAAmB,UAAU,KAAK,IAAI,EAAC,CAAC;AAAA,IACpF;AAAA,EACF,CAAC;AAGH,SAAO;AAAA,IACL,CAAC,IAAI,GAAG;AAAA,EACV;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { DEFAULT_STOP, DEFAULT_STOPS } from "./constants.js";
|
|
3
|
+
export function createSaturationScale(tweak = 0, stop = DEFAULT_STOP) {
|
|
4
|
+
let stops = DEFAULT_STOPS;
|
|
5
|
+
let index = stops.indexOf(stop);
|
|
6
|
+
if (index === -1) {
|
|
7
|
+
throw new Error(`Invalid key value: ${stop}`);
|
|
8
|
+
}
|
|
9
|
+
return stops.map((stop2) => {
|
|
10
|
+
let diff = Math.abs(stops.indexOf(stop2) - index);
|
|
11
|
+
let tweakValue = tweak ? Math.round((diff + 1) * tweak * (1 + diff / 10)) : 0;
|
|
12
|
+
if (tweakValue > 100) {
|
|
13
|
+
return { stop: stop2, tweak: 100 };
|
|
14
|
+
}
|
|
15
|
+
return { stop: stop2, tweak: tweakValue };
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=createSaturationScale.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/createSaturationScale.ts"],
|
|
4
|
+
"sourcesContent": ["import {DEFAULT_STOP, DEFAULT_STOPS} from './constants.js';\n\nexport function createSaturationScale(tweak = 0, stop: number = DEFAULT_STOP) {\n let stops: number[] = DEFAULT_STOPS as unknown as number[];\n let index = stops.indexOf(stop);\n\n if (index === -1) {\n throw new Error(`Invalid key value: ${stop}`);\n }\n\n return stops.map((stop) => {\n let diff = Math.abs(stops.indexOf(stop) - index);\n let tweakValue = tweak ? Math.round((diff + 1) * tweak * (1 + diff / 10)) : 0;\n\n if (tweakValue > 100) {\n return {stop, tweak: 100};\n }\n\n return {stop, tweak: tweakValue};\n });\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,cAAc,qBAAoB;AAEnC,gBAAS,sBAAsB,QAAQ,GAAG,OAAe,cAAc;AAC5E,MAAI,QAAkB;AACtB,MAAI,QAAQ,MAAM,QAAQ,IAAI;AAE9B,MAAI,UAAU,IAAI;AAChB,UAAM,IAAI,MAAM,sBAAsB,IAAI,EAAE;AAAA,EAC9C;AAEA,SAAO,MAAM,IAAI,CAACA,UAAS;AACzB,QAAI,OAAO,KAAK,IAAI,MAAM,QAAQA,KAAI,IAAI,KAAK;AAC/C,QAAI,aAAa,QAAQ,KAAK,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,IAAI;AAE5E,QAAI,aAAa,KAAK;AACpB,aAAO,EAAC,MAAAA,OAAM,OAAO,IAAG;AAAA,IAC1B;AAEA,WAAO,EAAC,MAAAA,OAAM,OAAO,WAAU;AAAA,EACjC,CAAC;AACH;",
|
|
6
|
+
"names": ["stop"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { clamp } from "./clamp.js";
|
|
3
|
+
import { createDistributionValues } from "./createDistributionValues.js";
|
|
4
|
+
import { createHueScale } from "./createHueScale.js";
|
|
5
|
+
import { createSaturationScale } from "./createSaturationScale.js";
|
|
6
|
+
import { hexToHsl } from "./hexToHsl.js";
|
|
7
|
+
import { hslToHex } from "./hslToHex.js";
|
|
8
|
+
import { unsignedModulo } from "./unsignedModulo.js";
|
|
9
|
+
export function createSwatches(palette) {
|
|
10
|
+
let hueScale = createHueScale(palette.h, palette.valueStop);
|
|
11
|
+
let saturationScale = createSaturationScale(palette.s, palette.valueStop);
|
|
12
|
+
let { h, s, l } = hexToHsl(palette.value);
|
|
13
|
+
let distributionScale = createDistributionValues(l, palette.valueStop);
|
|
14
|
+
let swatches = hueScale.map(({ stop }, stopIndex) => {
|
|
15
|
+
let newH = unsignedModulo(h + hueScale[stopIndex].tweak, 360);
|
|
16
|
+
let newS = clamp(s + saturationScale[stopIndex].tweak, 0, 100);
|
|
17
|
+
let newL = clamp(distributionScale[stopIndex].value, 0.1, 99.9);
|
|
18
|
+
let newHex = hslToHex(newH, newS, newL);
|
|
19
|
+
return {
|
|
20
|
+
stop,
|
|
21
|
+
hex: stop === palette.valueStop ? palette.value.toUpperCase() : newHex.toUpperCase(),
|
|
22
|
+
h: newH,
|
|
23
|
+
hScale: (unsignedModulo(hueScale[stopIndex].tweak + 180, 360) - 180) / 180 * 50,
|
|
24
|
+
s: newS,
|
|
25
|
+
sScale: newS - 50,
|
|
26
|
+
l: newL
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return swatches;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=createSwatches.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/createSwatches.ts"],
|
|
4
|
+
"sourcesContent": ["import {clamp} from './clamp.js';\nimport {createDistributionValues} from './createDistributionValues.js';\nimport {createHueScale} from './createHueScale.js';\nimport {createSaturationScale} from './createSaturationScale.js';\nimport {hexToHsl} from './hexToHsl.js';\nimport {hslToHex} from './hslToHex.js';\nimport {type PaletteConfig} from './PaletteConfig.js';\nimport {unsignedModulo} from './unsignedModulo.js';\n\nexport function createSwatches(palette: PaletteConfig) {\n let hueScale = createHueScale(palette.h, palette.valueStop);\n let saturationScale = createSaturationScale(palette.s, palette.valueStop);\n let {h, s, l} = hexToHsl(palette.value);\n let distributionScale = createDistributionValues(l, palette.valueStop);\n\n let swatches = hueScale.map(({stop}, stopIndex) => {\n let newH = unsignedModulo(h + hueScale[stopIndex]!.tweak, 360);\n let newS = clamp(s + saturationScale[stopIndex]!.tweak, 0, 100);\n let newL = clamp(distributionScale[stopIndex]!.value, 0.1, 99.9); // this is to make sure the first two or last two swatches (the first being total white and the last being total black) aren't the same lightness\n let newHex = hslToHex(newH, newS, newL);\n\n return {\n stop,\n hex: stop === palette.valueStop ? palette.value.toUpperCase() : newHex.toUpperCase(),\n h: newH,\n hScale: ((unsignedModulo(hueScale[stopIndex]!.tweak + 180, 360) - 180) / 180) * 50,\n s: newS,\n sScale: newS - 50,\n l: newL,\n };\n });\n\n return swatches;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,aAAY;AACpB,SAAQ,gCAA+B;AACvC,SAAQ,sBAAqB;AAC7B,SAAQ,6BAA4B;AACpC,SAAQ,gBAAe;AACvB,SAAQ,gBAAe;AAEvB,SAAQ,sBAAqB;AAEtB,gBAAS,eAAe,SAAwB;AACrD,MAAI,WAAW,eAAe,QAAQ,GAAG,QAAQ,SAAS;AAC1D,MAAI,kBAAkB,sBAAsB,QAAQ,GAAG,QAAQ,SAAS;AACxE,MAAI,EAAC,GAAG,GAAG,EAAC,IAAI,SAAS,QAAQ,KAAK;AACtC,MAAI,oBAAoB,yBAAyB,GAAG,QAAQ,SAAS;AAErE,MAAI,WAAW,SAAS,IAAI,CAAC,EAAC,KAAI,GAAG,cAAc;AACjD,QAAI,OAAO,eAAe,IAAI,SAAS,SAAS,EAAG,OAAO,GAAG;AAC7D,QAAI,OAAO,MAAM,IAAI,gBAAgB,SAAS,EAAG,OAAO,GAAG,GAAG;AAC9D,QAAI,OAAO,MAAM,kBAAkB,SAAS,EAAG,OAAO,KAAK,IAAI;AAC/D,QAAI,SAAS,SAAS,MAAM,MAAM,IAAI;AAEtC,WAAO;AAAA,MACL;AAAA,MACA,KAAK,SAAS,QAAQ,YAAY,QAAQ,MAAM,YAAY,IAAI,OAAO,YAAY;AAAA,MACnF,GAAG;AAAA,MACH,SAAU,eAAe,SAAS,SAAS,EAAG,QAAQ,KAAK,GAAG,IAAI,OAAO,MAAO;AAAA,MAChF,GAAG;AAAA,MACH,QAAQ,OAAO;AAAA,MACf,GAAG;AAAA,IACL;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { hexToRgb } from "./hexToRgb.js";
|
|
3
|
+
export function hexToHsl(rawHex) {
|
|
4
|
+
let hex = rawHex;
|
|
5
|
+
if (hex.length === 6 && !hex.startsWith(`#`)) {
|
|
6
|
+
hex = `#${hex}`;
|
|
7
|
+
}
|
|
8
|
+
let { r, g, b } = hexToRgb(hex);
|
|
9
|
+
r /= 255;
|
|
10
|
+
g /= 255;
|
|
11
|
+
b /= 255;
|
|
12
|
+
let cmin = Math.min(r, g, b);
|
|
13
|
+
let cmax = Math.max(r, g, b);
|
|
14
|
+
let delta = cmax - cmin;
|
|
15
|
+
let h = 0;
|
|
16
|
+
let s = 0;
|
|
17
|
+
let l = 0;
|
|
18
|
+
if (delta === 0) {
|
|
19
|
+
h = 0;
|
|
20
|
+
} else if (cmax === r) {
|
|
21
|
+
h = (g - b) / delta % 6;
|
|
22
|
+
} else if (cmax === g) {
|
|
23
|
+
h = (b - r) / delta + 2;
|
|
24
|
+
} else {
|
|
25
|
+
h = (r - g) / delta + 4;
|
|
26
|
+
}
|
|
27
|
+
h = Math.round(h * 60);
|
|
28
|
+
if (h < 0) {
|
|
29
|
+
h += 360;
|
|
30
|
+
}
|
|
31
|
+
l = (cmax + cmin) / 2;
|
|
32
|
+
s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
|
|
33
|
+
s = +(s * 100).toFixed(1);
|
|
34
|
+
l = +(l * 100).toFixed(1);
|
|
35
|
+
return { h, s, l };
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=hexToHsl.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/hexToHsl.ts"],
|
|
4
|
+
"sourcesContent": ["import {hexToRgb} from './hexToRgb.js';\n\nexport function hexToHsl(rawHex: string) {\n let hex = rawHex;\n\n if (hex.length === 6 && !hex.startsWith(`#`)) {\n hex = `#${hex}`;\n }\n\n let {r, g, b} = hexToRgb(hex);\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n let cmin = Math.min(r, g, b);\n let cmax = Math.max(r, g, b);\n let delta = cmax - cmin;\n let h = 0;\n let s = 0;\n let l = 0;\n\n if (delta === 0) {\n h = 0;\n } else if (cmax === r) {\n h = ((g - b) / delta) % 6;\n } else if (cmax === g) {\n h = (b - r) / delta + 2;\n } else {\n h = (r - g) / delta + 4;\n }\n\n h = Math.round(h * 60);\n\n if (h < 0) {\n h += 360;\n }\n\n l = (cmax + cmin) / 2;\n s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));\n s = +(s * 100).toFixed(1);\n l = +(l * 100).toFixed(1);\n\n return {h, s, l}; // values can be used like this: `hsl(${h}, ${s}%, ${l}%)`\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,gBAAe;AAEhB,gBAAS,SAAS,QAAgB;AACvC,MAAI,MAAM;AAEV,MAAI,IAAI,WAAW,KAAK,CAAC,IAAI,WAAW,GAAG,GAAG;AAC5C,UAAM,IAAI,GAAG;AAAA,EACf;AAEA,MAAI,EAAC,GAAG,GAAG,EAAC,IAAI,SAAS,GAAG;AAE5B,OAAK;AACL,OAAK;AACL,OAAK;AAEL,MAAI,OAAO,KAAK,IAAI,GAAG,GAAG,CAAC;AAC3B,MAAI,OAAO,KAAK,IAAI,GAAG,GAAG,CAAC;AAC3B,MAAI,QAAQ,OAAO;AACnB,MAAI,IAAI;AACR,MAAI,IAAI;AACR,MAAI,IAAI;AAER,MAAI,UAAU,GAAG;AACf,QAAI;AAAA,EACN,WAAW,SAAS,GAAG;AACrB,SAAM,IAAI,KAAK,QAAS;AAAA,EAC1B,WAAW,SAAS,GAAG;AACrB,SAAK,IAAI,KAAK,QAAQ;AAAA,EACxB,OAAO;AACL,SAAK,IAAI,KAAK,QAAQ;AAAA,EACxB;AAEA,MAAI,KAAK,MAAM,IAAI,EAAE;AAErB,MAAI,IAAI,GAAG;AACT,SAAK;AAAA,EACP;AAEA,OAAK,OAAO,QAAQ;AACpB,MAAI,UAAU,IAAI,IAAI,SAAS,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC;AACrD,MAAI,EAAE,IAAI,KAAK,QAAQ,CAAC;AACxB,MAAI,EAAE,IAAI,KAAK,QAAQ,CAAC;AAExB,SAAO,EAAC,GAAG,GAAG,EAAC;AACjB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
export function hexToRgb(rawHex) {
|
|
3
|
+
let hex = rawHex;
|
|
4
|
+
if (hex.length === 6 && !hex.startsWith(`#`)) {
|
|
5
|
+
hex = `#${hex}`;
|
|
6
|
+
}
|
|
7
|
+
let r = `0`;
|
|
8
|
+
let g = `0`;
|
|
9
|
+
let b = `0`;
|
|
10
|
+
if (hex.length === 4) {
|
|
11
|
+
r = `0x${hex[1]}${hex[1]}`;
|
|
12
|
+
g = `0x${hex[2]}${hex[2]}`;
|
|
13
|
+
b = `0x${hex[3]}${hex[3]}`;
|
|
14
|
+
} else if (hex.length === 7) {
|
|
15
|
+
r = `0x${hex[1]}${hex[2]}`;
|
|
16
|
+
g = `0x${hex[3]}${hex[4]}`;
|
|
17
|
+
b = `0x${hex[5]}${hex[6]}`;
|
|
18
|
+
}
|
|
19
|
+
return { r: Number(r), g: Number(g), b: Number(b) };
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=hexToRgb.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/hexToRgb.ts"],
|
|
4
|
+
"sourcesContent": ["export function hexToRgb(rawHex: string) {\n let hex = rawHex;\n\n if (hex.length === 6 && !hex.startsWith(`#`)) {\n hex = `#${hex}`;\n }\n\n let r = `0`;\n let g = `0`;\n let b = `0`;\n\n if (hex.length === 4) {\n r = `0x${hex[1]}${hex[1]}`;\n g = `0x${hex[2]}${hex[2]}`;\n b = `0x${hex[3]}${hex[3]}`;\n } else if (hex.length === 7) {\n r = `0x${hex[1]}${hex[2]}`;\n g = `0x${hex[3]}${hex[4]}`;\n b = `0x${hex[5]}${hex[6]}`;\n }\n\n return {r: Number(r), g: Number(g), b: Number(b)};\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,gBAAS,SAAS,QAAgB;AACvC,MAAI,MAAM;AAEV,MAAI,IAAI,WAAW,KAAK,CAAC,IAAI,WAAW,GAAG,GAAG;AAC5C,UAAM,IAAI,GAAG;AAAA,EACf;AAEA,MAAI,IAAI;AACR,MAAI,IAAI;AACR,MAAI,IAAI;AAER,MAAI,IAAI,WAAW,GAAG;AACpB,QAAI,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACxB,QAAI,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACxB,QAAI,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAAA,EAC1B,WAAW,IAAI,WAAW,GAAG;AAC3B,QAAI,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACxB,QAAI,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACxB,QAAI,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAAA,EAC1B;AAEA,SAAO,EAAC,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,EAAC;AAClD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hslToHex(h: number, s: number, l: number): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { hslToRgb } from "./hslToRgb.js";
|
|
3
|
+
export function hslToHex(h, s, l) {
|
|
4
|
+
let { r, g, b } = hslToRgb(h, s, l);
|
|
5
|
+
let rHex = r.toString(16);
|
|
6
|
+
let gHex = g.toString(16);
|
|
7
|
+
let bHex = b.toString(16);
|
|
8
|
+
if (rHex.length === 1) {
|
|
9
|
+
rHex = `0${rHex}`;
|
|
10
|
+
}
|
|
11
|
+
if (gHex.length === 1) {
|
|
12
|
+
gHex = `0${gHex}`;
|
|
13
|
+
}
|
|
14
|
+
if (bHex.length === 1) {
|
|
15
|
+
bHex = `0${bHex}`;
|
|
16
|
+
}
|
|
17
|
+
return `#${rHex}${gHex}${bHex}`;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=hslToHex.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/hslToHex.ts"],
|
|
4
|
+
"sourcesContent": ["import {hslToRgb} from './hslToRgb.js';\n\nexport function hslToHex(h: number, s: number, l: number) {\n let {r, g, b} = hslToRgb(h, s, l);\n\n let rHex = r.toString(16);\n let gHex = g.toString(16);\n let bHex = b.toString(16);\n\n if (rHex.length === 1) {\n rHex = `0${rHex}`;\n }\n\n if (gHex.length === 1) {\n gHex = `0${gHex}`;\n }\n\n if (bHex.length === 1) {\n bHex = `0${bHex}`;\n }\n\n return `#${rHex}${gHex}${bHex}`;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,gBAAe;AAEhB,gBAAS,SAAS,GAAW,GAAW,GAAW;AACxD,MAAI,EAAC,GAAG,GAAG,EAAC,IAAI,SAAS,GAAG,GAAG,CAAC;AAEhC,MAAI,OAAO,EAAE,SAAS,EAAE;AACxB,MAAI,OAAO,EAAE,SAAS,EAAE;AACxB,MAAI,OAAO,EAAE,SAAS,EAAE;AAExB,MAAI,KAAK,WAAW,GAAG;AACrB,WAAO,IAAI,IAAI;AAAA,EACjB;AAEA,MAAI,KAAK,WAAW,GAAG;AACrB,WAAO,IAAI,IAAI;AAAA,EACjB;AAEA,MAAI,KAAK,WAAW,GAAG;AACrB,WAAO,IAAI,IAAI;AAAA,EACjB;AAEA,SAAO,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI;AAC/B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
export function hslToRgb(h, rawS, rawL) {
|
|
3
|
+
let s = rawS / 100;
|
|
4
|
+
let l = rawL / 100;
|
|
5
|
+
let c = (1 - Math.abs(2 * l - 1)) * s;
|
|
6
|
+
let x = c * (1 - Math.abs(h / 60 % 2 - 1));
|
|
7
|
+
let m = l - c / 2;
|
|
8
|
+
let r = 0;
|
|
9
|
+
let g = 0;
|
|
10
|
+
let b = 0;
|
|
11
|
+
if (h >= 0 && h < 60) {
|
|
12
|
+
r = c;
|
|
13
|
+
g = x;
|
|
14
|
+
b = 0;
|
|
15
|
+
} else if (h >= 60 && h < 120) {
|
|
16
|
+
r = x;
|
|
17
|
+
g = c;
|
|
18
|
+
b = 0;
|
|
19
|
+
} else if (h >= 120 && h < 180) {
|
|
20
|
+
r = 0;
|
|
21
|
+
g = c;
|
|
22
|
+
b = x;
|
|
23
|
+
} else if (h >= 180 && h < 240) {
|
|
24
|
+
r = 0;
|
|
25
|
+
g = x;
|
|
26
|
+
b = c;
|
|
27
|
+
} else if (h >= 240 && h < 300) {
|
|
28
|
+
r = x;
|
|
29
|
+
g = 0;
|
|
30
|
+
b = c;
|
|
31
|
+
} else if (h >= 300 && h < 360) {
|
|
32
|
+
r = c;
|
|
33
|
+
g = 0;
|
|
34
|
+
b = x;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
r: Math.round((r + m) * 255),
|
|
38
|
+
g: Math.round((g + m) * 255),
|
|
39
|
+
b: Math.round((b + m) * 255)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=hslToRgb.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/hslToRgb.ts"],
|
|
4
|
+
"sourcesContent": ["export function hslToRgb(h: number, rawS: number, rawL: number) {\n let s = rawS / 100;\n let l = rawL / 100;\n\n let c = (1 - Math.abs(2 * l - 1)) * s;\n let x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n let m = l - c / 2;\n let r = 0;\n let g = 0;\n let b = 0;\n\n if (h >= 0 && h < 60) {\n r = c;\n g = x;\n b = 0;\n } else if (h >= 60 && h < 120) {\n r = x;\n g = c;\n b = 0;\n } else if (h >= 120 && h < 180) {\n r = 0;\n g = c;\n b = x;\n } else if (h >= 180 && h < 240) {\n r = 0;\n g = x;\n b = c;\n } else if (h >= 240 && h < 300) {\n r = x;\n g = 0;\n b = c;\n } else if (h >= 300 && h < 360) {\n r = c;\n g = 0;\n b = x;\n }\n\n return {\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n };\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,gBAAS,SAAS,GAAW,MAAc,MAAc;AAC9D,MAAI,IAAI,OAAO;AACf,MAAI,IAAI,OAAO;AAEf,MAAI,KAAK,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK;AACpC,MAAI,IAAI,KAAK,IAAI,KAAK,IAAM,IAAI,KAAM,IAAK,CAAC;AAC5C,MAAI,IAAI,IAAI,IAAI;AAChB,MAAI,IAAI;AACR,MAAI,IAAI;AACR,MAAI,IAAI;AAER,MAAI,KAAK,KAAK,IAAI,IAAI;AACpB,QAAI;AACJ,QAAI;AACJ,QAAI;AAAA,EACN,WAAW,KAAK,MAAM,IAAI,KAAK;AAC7B,QAAI;AACJ,QAAI;AACJ,QAAI;AAAA,EACN,WAAW,KAAK,OAAO,IAAI,KAAK;AAC9B,QAAI;AACJ,QAAI;AACJ,QAAI;AAAA,EACN,WAAW,KAAK,OAAO,IAAI,KAAK;AAC9B,QAAI;AACJ,QAAI;AACJ,QAAI;AAAA,EACN,WAAW,KAAK,OAAO,IAAI,KAAK;AAC9B,QAAI;AACJ,QAAI;AACJ,QAAI;AAAA,EACN,WAAW,KAAK,OAAO,IAAI,KAAK;AAC9B,QAAI;AACJ,QAAI;AACJ,QAAI;AAAA,EACN;AAEA,SAAO;AAAA,IACL,GAAG,KAAK,OAAO,IAAI,KAAK,GAAG;AAAA,IAC3B,GAAG,KAAK,OAAO,IAAI,KAAK,GAAG;AAAA,IAC3B,GAAG,KAAK,OAAO,IAAI,KAAK,GAAG;AAAA,EAC7B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isHex(value: string): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/isHex.ts"],
|
|
4
|
+
"sourcesContent": ["export function isHex(value: string) {\n const valueHex = value.length === 6 && !value.startsWith(`#`) ? `#${value}` : value;\n\n const re = new RegExp(/^#[\\da-f]{6}$/i);\n\n return re.test(valueHex.toUpperCase());\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,gBAAS,MAAM,OAAe;AACnC,QAAM,WAAW,MAAM,WAAW,KAAK,CAAC,MAAM,WAAW,GAAG,IAAI,IAAI,KAAK,KAAK;AAE9E,QAAM,KAAK,IAAI,OAAO,gBAAgB;AAEtC,SAAO,GAAG,KAAK,SAAS,YAAY,CAAC;AACvC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveModule(moduleId: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import module from "node:module";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
export function resolveModule(moduleId) {
|
|
5
|
+
let require = module.createRequire(import.meta.url);
|
|
6
|
+
let modulePath = path.dirname(require.resolve(`${moduleId}/package.json`));
|
|
7
|
+
return modulePath;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=resolveModule.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/resolveModule.ts"],
|
|
4
|
+
"sourcesContent": ["import module from 'node:module';\nimport path from 'node:path';\n\nexport function resolveModule(moduleId: string) {\n let require = module.createRequire(import.meta.url);\n let modulePath = path.dirname(require.resolve(`${moduleId}/package.json`));\n\n return modulePath;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,YAAY;AACnB,OAAO,UAAU;AAEV,gBAAS,cAAc,UAAkB;AAC9C,MAAI,UAAU,OAAO,cAAc,YAAY,GAAG;AAClD,MAAI,aAAa,KAAK,QAAQ,QAAQ,QAAQ,GAAG,QAAQ,eAAe,CAAC;AAEzE,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function round(value: number, precision?: number): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../source/development/internals/round.ts"],
|
|
4
|
+
"sourcesContent": ["export function round(value: number, precision = 0) {\n const multiplier = 10 ** precision;\n\n return Math.round(value * multiplier) / multiplier;\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,gBAAS,MAAM,OAAe,YAAY,GAAG;AAClD,QAAM,aAAa,MAAM;AAEzB,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function unsignedModulo(x: number, n: number): number;
|