@serendie/ui 2.2.3 → 2.2.4-dev.202510160446

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 (40) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +1 -1
  2. package/dist/components/Avatar/Avatar.d.ts +1 -1
  3. package/dist/components/Banner/Banner.d.ts +1 -1
  4. package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
  5. package/dist/components/Button/Button.d.ts +2 -2
  6. package/dist/components/DatePicker/DatePicker.d.ts +5 -5
  7. package/dist/components/DatePicker/DatePicker.js +79 -77
  8. package/dist/components/DropdownMenu/DropdownMenu.d.ts +1 -1
  9. package/dist/components/IconButton/IconButton.d.ts +3 -3
  10. package/dist/components/List/ListItem.d.ts +1 -1
  11. package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
  12. package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
  13. package/dist/components/Pagination/Pagination.d.ts +1 -1
  14. package/dist/components/Search/Search.d.ts +1 -1
  15. package/dist/components/Select/Select.d.ts +1 -1
  16. package/dist/components/Select/Select.js +12 -8
  17. package/dist/components/Switch/Switch.d.ts +1 -1
  18. package/dist/components/Tabs/Tabs.d.ts +1 -1
  19. package/dist/components/TextArea/TextArea.d.ts +1 -0
  20. package/dist/components/TextArea/TextArea.js +15 -8
  21. package/dist/components/TextField/TextField.d.ts +2 -0
  22. package/dist/components/TextField/TextField.js +4 -2
  23. package/dist/components/Toast/Toast.d.ts +1 -1
  24. package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
  25. package/dist/preset.d.ts +0 -3
  26. package/dist/preset.js +7 -9
  27. package/dist/recipes/textFieldRecipe.d.ts +9 -2
  28. package/dist/recipes/textFieldRecipe.js +13 -3
  29. package/dist/styled-system/css/cva.js +38 -43
  30. package/dist/styles.css +1 -1
  31. package/package.json +1 -1
  32. package/dist/recipes/index.d.ts +0 -3
  33. package/dist/recipes/index.js +0 -7
  34. package/dist/styled-system/recipes/create-recipe.js +0 -37
  35. package/dist/styled-system/recipes/text-field-recipe.js +0 -61
  36. package/styled-system/recipes/create-recipe.js +0 -82
  37. package/styled-system/recipes/index.d.ts +0 -2
  38. package/styled-system/recipes/index.js +0 -1
  39. package/styled-system/recipes/text-field-recipe.d.ts +0 -28
  40. package/styled-system/recipes/text-field-recipe.js +0 -72
@@ -1,82 +0,0 @@
1
- import { finalizeConditions, sortConditions } from '../css/conditions.js';
2
- import { css } from '../css/css.js';
3
- import { assertCompoundVariant, getCompoundVariantCss } from '../css/cva.js';
4
- import { cx } from '../css/cx.js';
5
- import { compact, createCss, splitProps, uniq, withoutSpace } from '../helpers.js';
6
-
7
- export const createRecipe = (name, defaultVariants, compoundVariants) => {
8
- const getVariantProps = (variants) => {
9
- return {
10
- [name]: '__ignore__',
11
- ...defaultVariants,
12
- ...compact(variants),
13
- };
14
- };
15
-
16
- const recipeFn = (variants, withCompoundVariants = true) => {
17
- const transform = (prop, value) => {
18
- assertCompoundVariant(name, compoundVariants, variants, prop)
19
-
20
- if (value === '__ignore__') {
21
- return { className: name }
22
- }
23
-
24
- value = withoutSpace(value)
25
- return { className: `${name}--${prop}_${value}` }
26
- }
27
-
28
- const recipeCss = createCss({
29
-
30
- conditions: {
31
- shift: sortConditions,
32
- finalize: finalizeConditions,
33
- breakpoints: { keys: ["base","expanded"] }
34
- },
35
- utility: {
36
-
37
- toHash: (path, hashFn) => hashFn(path.join(":")),
38
- transform,
39
- }
40
- })
41
-
42
- const recipeStyles = getVariantProps(variants)
43
-
44
- if (withCompoundVariants) {
45
- const compoundVariantStyles = getCompoundVariantCss(compoundVariants, recipeStyles)
46
- return cx(recipeCss(recipeStyles), css(compoundVariantStyles))
47
- }
48
-
49
- return recipeCss(recipeStyles)
50
- }
51
-
52
- return {
53
- recipeFn,
54
- getVariantProps,
55
- __getCompoundVariantCss__: (variants) => {
56
- return getCompoundVariantCss(compoundVariants, getVariantProps(variants));
57
- },
58
- }
59
- }
60
-
61
- export const mergeRecipes = (recipeA, recipeB) => {
62
- if (recipeA && !recipeB) return recipeA
63
- if (!recipeA && recipeB) return recipeB
64
-
65
- const recipeFn = (...args) => cx(recipeA(...args), recipeB(...args))
66
- const variantKeys = uniq(recipeA.variantKeys, recipeB.variantKeys)
67
- const variantMap = variantKeys.reduce((acc, key) => {
68
- acc[key] = uniq(recipeA.variantMap[key], recipeB.variantMap[key])
69
- return acc
70
- }, {})
71
-
72
- return Object.assign(recipeFn, {
73
- __recipe__: true,
74
- __name__: `${recipeA.__name__} ${recipeB.__name__}`,
75
- raw: (props) => props,
76
- variantKeys,
77
- variantMap,
78
- splitVariantProps(props) {
79
- return splitProps(props, variantKeys)
80
- },
81
- })
82
- }
@@ -1,2 +0,0 @@
1
- /* eslint-disable */
2
- export * from './text-field-recipe';
@@ -1 +0,0 @@
1
- export * from './text-field-recipe.js';
@@ -1,28 +0,0 @@
1
- /* eslint-disable */
2
- import type { ConditionalValue } from '../types/index';
3
- import type { DistributiveOmit, Pretty } from '../types/system-types';
4
-
5
- interface TextFieldRecipeVariant {
6
-
7
- }
8
-
9
- type TextFieldRecipeVariantMap = {
10
- [key in keyof TextFieldRecipeVariant]: Array<TextFieldRecipeVariant[key]>
11
- }
12
-
13
- export type TextFieldRecipeVariantProps = {
14
- [key in keyof TextFieldRecipeVariant]?: ConditionalValue<TextFieldRecipeVariant[key]> | undefined
15
- }
16
-
17
- export interface TextFieldRecipeRecipe {
18
- __type: TextFieldRecipeVariantProps
19
- (props?: TextFieldRecipeVariantProps): Pretty<Record<"root" | "label" | "labelRequired" | "inputWrapper" | "input" | "icon" | "leftContent" | "rightContent" | "messageField" | "description" | "invalidMessage", string>>
20
- raw: (props?: TextFieldRecipeVariantProps) => TextFieldRecipeVariantProps
21
- variantMap: TextFieldRecipeVariantMap
22
- variantKeys: Array<keyof TextFieldRecipeVariant>
23
- splitVariantProps<Props extends TextFieldRecipeVariantProps>(props: Props): [TextFieldRecipeVariantProps, Pretty<DistributiveOmit<Props, keyof TextFieldRecipeVariantProps>>]
24
- getVariantProps: (props?: TextFieldRecipeVariantProps) => TextFieldRecipeVariantProps
25
- }
26
-
27
-
28
- export declare const textFieldRecipe: TextFieldRecipeRecipe
@@ -1,72 +0,0 @@
1
- import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.js';
2
- import { createRecipe } from './create-recipe.js';
3
-
4
- const textFieldRecipeDefaultVariants = {}
5
- const textFieldRecipeCompoundVariants = []
6
-
7
- const textFieldRecipeSlotNames = [
8
- [
9
- "root",
10
- "input__root"
11
- ],
12
- [
13
- "label",
14
- "input__label"
15
- ],
16
- [
17
- "labelRequired",
18
- "input__labelRequired"
19
- ],
20
- [
21
- "inputWrapper",
22
- "input__inputWrapper"
23
- ],
24
- [
25
- "input",
26
- "input__input"
27
- ],
28
- [
29
- "icon",
30
- "input__icon"
31
- ],
32
- [
33
- "leftContent",
34
- "input__leftContent"
35
- ],
36
- [
37
- "rightContent",
38
- "input__rightContent"
39
- ],
40
- [
41
- "messageField",
42
- "input__messageField"
43
- ],
44
- [
45
- "description",
46
- "input__description"
47
- ],
48
- [
49
- "invalidMessage",
50
- "input__invalidMessage"
51
- ]
52
- ]
53
- const textFieldRecipeSlotFns = /* @__PURE__ */ textFieldRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, textFieldRecipeDefaultVariants, getSlotCompoundVariant(textFieldRecipeCompoundVariants, slotName))])
54
-
55
- const textFieldRecipeFn = memo((props = {}) => {
56
- return Object.fromEntries(textFieldRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
57
- })
58
-
59
- const textFieldRecipeVariantKeys = []
60
- const getVariantProps = (variants) => ({ ...textFieldRecipeDefaultVariants, ...compact(variants) })
61
-
62
- export const textFieldRecipe = /* @__PURE__ */ Object.assign(textFieldRecipeFn, {
63
- __recipe__: false,
64
- __name__: 'textFieldRecipe',
65
- raw: (props) => props,
66
- variantKeys: textFieldRecipeVariantKeys,
67
- variantMap: {},
68
- splitVariantProps(props) {
69
- return splitProps(props, textFieldRecipeVariantKeys)
70
- },
71
- getVariantProps
72
- })