@soyfri/shared-library 2.0.0-beta.19 → 2.0.0-beta.20
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/dist/{Autocomplete-QTPCObBL.js → Autocomplete-C_lW1VER.js} +4 -6
- package/dist/Autocomplete-C_lW1VER.js.map +1 -0
- package/dist/{Autocomplete-DBWWcKQO.cjs → Autocomplete-CejWztBY.cjs} +4 -6
- package/dist/Autocomplete-CejWztBY.cjs.map +1 -0
- package/dist/{DatePicker-kWjQEXIQ.js → DatePicker-_IGWc3I5.js} +4 -6
- package/dist/DatePicker-_IGWc3I5.js.map +1 -0
- package/dist/{DatePicker-CUHUAzW4.cjs → DatePicker-t7uDTZMl.cjs} +4 -6
- package/dist/DatePicker-t7uDTZMl.cjs.map +1 -0
- package/dist/{DateTimePicker-AVmtL4vS.cjs → DateTimePicker-BxQyjTCY.cjs} +5 -7
- package/dist/DateTimePicker-BxQyjTCY.cjs.map +1 -0
- package/dist/{DateTimePicker-BO76eZ0P.js → DateTimePicker-CrmWav_j.js} +5 -7
- package/dist/DateTimePicker-CrmWav_j.js.map +1 -0
- package/dist/{Input-5VGBxiO2.cjs → Input-CScC87J5.cjs} +4 -6
- package/dist/Input-CScC87J5.cjs.map +1 -0
- package/dist/{Input-BVaetLBc.js → Input-DP_fKl38.js} +4 -6
- package/dist/Input-DP_fKl38.js.map +1 -0
- package/dist/{Select-8fFMOx-I.js → Select-D5OrjVj3.js} +4 -5
- package/dist/Select-D5OrjVj3.js.map +1 -0
- package/dist/{Select-DyWV0aL9.cjs → Select-Dyvc4bVo.cjs} +4 -5
- package/dist/Select-Dyvc4bVo.cjs.map +1 -0
- package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.sx.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DatePicker/DatePicker.sx.d.ts +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.sx.d.ts +1 -1
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.sx.d.ts +1 -1
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/Select.sx.d.ts +1 -1
- package/dist/components/_shared/formField.sx.d.ts +1 -11
- package/dist/{formField.sx-Cmhj9iGb.js → formField.sx-8_QRnKxv.js} +15 -15
- package/dist/formField.sx-8_QRnKxv.js.map +1 -0
- package/dist/{formField.sx-V9PLO0wv.cjs → formField.sx-BAX7KwMR.cjs} +15 -15
- package/dist/formField.sx-BAX7KwMR.cjs.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.js +5 -5
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/src/components/Autocomplete/Autocomplete.sx.ts +0 -2
- package/src/components/Autocomplete/Autocomplete.tsx +1 -2
- package/src/components/DatePicker/DatePicker.sx.ts +0 -2
- package/src/components/DatePicker/DatePicker.tsx +1 -2
- package/src/components/DateTimePicker/DateTimePicker.sx.ts +0 -2
- package/src/components/DateTimePicker/DateTimePicker.tsx +2 -3
- package/src/components/Input/Input.sx.ts +0 -2
- package/src/components/Input/Input.tsx +1 -2
- package/src/components/Select/Select.sx.ts +1 -2
- package/src/components/Select/Select.tsx +1 -2
- package/src/components/_shared/formField.sx.ts +6 -22
- package/dist/Autocomplete-DBWWcKQO.cjs.map +0 -1
- package/dist/Autocomplete-QTPCObBL.js.map +0 -1
- package/dist/DatePicker-CUHUAzW4.cjs.map +0 -1
- package/dist/DatePicker-kWjQEXIQ.js.map +0 -1
- package/dist/DateTimePicker-AVmtL4vS.cjs.map +0 -1
- package/dist/DateTimePicker-BO76eZ0P.js.map +0 -1
- package/dist/Input-5VGBxiO2.cjs.map +0 -1
- package/dist/Input-BVaetLBc.js.map +0 -1
- package/dist/Select-8fFMOx-I.js.map +0 -1
- package/dist/Select-DyWV0aL9.cjs.map +0 -1
- package/dist/formField.sx-Cmhj9iGb.js.map +0 -1
- package/dist/formField.sx-V9PLO0wv.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formField.sx-Cmhj9iGb.js","sources":["../src/components/_shared/formField.sx.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\nimport {\n LABEL_COLOR_FILLED,\n LABEL_COLOR_FOCUSED,\n LABEL_COLOR_REST,\n LABEL_FONT_WEIGHT_FILLED,\n LABEL_MARGIN_TOP,\n LABEL_SHRINK_TRANSFORM,\n LABEL_TRANSFORM_ORIGIN,\n LABEL_TRANSITION,\n} from '../../theme/tokens';\n\nexport type LabelPosition = 'outside' | 'floating';\n\nexport interface BuildFormFieldSxOptions {\n borderRadius: number | string;\n labelPosition: LabelPosition;\n /**\n * Si es `true`, los selectores incluyen también la API nueva de MUI X\n * Pickers (v8): `MuiPickersInputBase-root`, `MuiPickersOutlinedInput-*`.\n */\n includePickersApi?: boolean;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'outside'.\n * Usar para paddings específicos del componente (p.ej. MuiAutocomplete-input).\n */\n extraOutsideSx?: Record<string, any>;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'floating'.\n */\n extraFloatingSx?: Record<string, any>;\n /**\n * Cuando es `true`, se emiten sólo los estilos estructurales de layout\n * (marginTop, posición del label, notch oculto, helpers) y se omiten los\n * estilos visuales (colores del label, borderRadius del input base).\n *\n * Usar cuando el consumer registra un preset de host: el preset asume el\n * control visual total, y los `styleOverrides` del host pueden actuar sin\n * ser bloqueados por los estilos inline de la librería.\n */\n layoutOnly?: boolean;\n}\n\nconst toRadius = (borderRadius: number | string) =>\n typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;\n\n/**\n * Builder del sx compartido por todos los campos de formulario\n * (Input/Select/Autocomplete/DatePicker/DateTimePicker).\n *\n * Produce:\n * - en modo \"floating\": sólo el border-radius del outlined input;\n * - en modo \"outside\": todo el pack (margen superior, label flotante afuera,\n * input base, notched outline oculto, helper text sin margen izquierdo).\n *\n * Componentes con paddings o selectores propios pueden inyectarlos vía\n * `extraOutsideSx` / `extraFloatingSx`.\n */\nexport const buildFormFieldSx = ({\n borderRadius,\n labelPosition,\n includePickersApi = false,\n extraOutsideSx,\n extraFloatingSx,\n layoutOnly = false,\n}: BuildFormFieldSxOptions): SxProps<Theme> => {\n const radius = toRadius(borderRadius);\n\n // ── Selectores (alternan según la API de pickers) ────────────────────\n const outlinedRootSelector = includePickersApi\n ? '& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root'\n : '& .MuiOutlinedInput-root';\n\n const inputBaseSelector = includePickersApi\n ? '& .MuiInputBase-root, & .MuiPickersInputBase-root'\n : '& .MuiInputBase-root';\n\n const notchedOutlineSelector = includePickersApi\n ? '& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline'\n : '& .MuiOutlinedInput-notchedOutline';\n\n // ── Floating ─────────────────────────────────────────────────────────\n if (labelPosition === 'floating') {\n return {\n // Visual borderRadius only when no preset — preset controls it when layoutOnly.\n ...(!layoutOnly && { [outlinedRootSelector]: { borderRadius: radius } }),\n ...(extraFloatingSx ?? {}),\n };\n }\n\n // ── Outside ──────────────────────────────────────────────────────────\n return {\n marginTop: LABEL_MARGIN_TOP,\n\n '& .MuiInputLabel-root': {\n // Visual label colors omitted when layoutOnly — host styleOverrides or preset handles them.\n ...(!layoutOnly && { color: LABEL_COLOR_REST }),\n transition: LABEL_TRANSITION,\n\n // Estado shrunk (focused o con valor): flota ARRIBA del input.\n '&.MuiInputLabel-shrink': {\n transform: LABEL_SHRINK_TRANSFORM,\n transformOrigin: LABEL_TRANSFORM_ORIGIN,\n ...(!layoutOnly && {\n color: LABEL_COLOR_FILLED,\n fontWeight: LABEL_FONT_WEIGHT_FILLED,\n }),\n },\n\n ...(!layoutOnly && { '&.Mui-focused': { color: LABEL_COLOR_FOCUSED } }),\n },\n\n // Input base — centra verticalmente (clásico y, si aplica, pickers).\n [inputBaseSelector]: {\n // Visual borderRadius omitted when layoutOnly — preset sets it on the root.\n ...(!layoutOnly && { borderRadius: radius }),\n display: 'flex',\n alignItems: 'center',\n },\n\n // El label flota afuera: ocultar legend del notch.\n [notchedOutlineSelector]: {\n top: 0,\n '& legend': { display: 'none' },\n },\n\n '& .MuiFormHelperText-root': {\n marginLeft: 0,\n },\n\n ...(extraOutsideSx ?? {}),\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,WAAW,CAAC,iBAChB,OAAO,iBAAiB,WAAW,GAAG,YAAY,OAAO;AAcpD,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,aAAa;AACf,MAA+C;AAC7C,QAAM,SAAS,SAAS,YAAY;AAGpC,QAAM,uBAAuB,oBACzB,8DACA;AAEJ,QAAM,oBAAoB,oBACtB,sDACA;AAEJ,QAAM,yBAAyB,oBAC3B,kFACA;AAGJ,MAAI,kBAAkB,YAAY;AAChC,WAAO,kCAED,CAAC,cAAc,EAAE,CAAC,oBAAoB,GAAG,EAAE,cAAc,SAAO,IAChE,4CAAmB,CAAA;AAAA,EAE3B;AAGA,SAAO;AAAA,IACL,WAAW;AAAA,IAEX,yBAAyB,gDAEnB,CAAC,cAAc,EAAE,OAAO,iBAAA,IAFL;AAAA,MAGvB,YAAY;AAAA;AAAA,MAGZ,0BAA0B;AAAA,QACxB,WAAW;AAAA,QACX,iBAAiB;AAAA,SACb,CAAC,cAAc;AAAA,QACjB,OAAO;AAAA,QACP,YAAY;AAAA,MAAA;AAAA,QAIZ,CAAC,cAAc,EAAE,iBAAiB,EAAE,OAAO,sBAAoB;AAAA;AAAA,IAIrE,CAAC,iBAAiB,GAAG,iCAEf,CAAC,cAAc,EAAE,cAAc,OAAA,IAFhB;AAAA,MAGnB,SAAS;AAAA,MACT,YAAY;AAAA,IAAA;AAAA;AAAA,IAId,CAAC,sBAAsB,GAAG;AAAA,MACxB,KAAK;AAAA,MACL,YAAY,EAAE,SAAS,OAAA;AAAA,IAAO;AAAA,IAGhC,6BAA6B;AAAA,MAC3B,YAAY;AAAA,IAAA;AAAA,KAGV,0CAAkB,CAAA;AAE1B;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formField.sx-V9PLO0wv.cjs","sources":["../src/components/_shared/formField.sx.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material/styles';\n\nimport {\n LABEL_COLOR_FILLED,\n LABEL_COLOR_FOCUSED,\n LABEL_COLOR_REST,\n LABEL_FONT_WEIGHT_FILLED,\n LABEL_MARGIN_TOP,\n LABEL_SHRINK_TRANSFORM,\n LABEL_TRANSFORM_ORIGIN,\n LABEL_TRANSITION,\n} from '../../theme/tokens';\n\nexport type LabelPosition = 'outside' | 'floating';\n\nexport interface BuildFormFieldSxOptions {\n borderRadius: number | string;\n labelPosition: LabelPosition;\n /**\n * Si es `true`, los selectores incluyen también la API nueva de MUI X\n * Pickers (v8): `MuiPickersInputBase-root`, `MuiPickersOutlinedInput-*`.\n */\n includePickersApi?: boolean;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'outside'.\n * Usar para paddings específicos del componente (p.ej. MuiAutocomplete-input).\n */\n extraOutsideSx?: Record<string, any>;\n /**\n * Selectores/valores extra que se mergean SOLO cuando labelPosition === 'floating'.\n */\n extraFloatingSx?: Record<string, any>;\n /**\n * Cuando es `true`, se emiten sólo los estilos estructurales de layout\n * (marginTop, posición del label, notch oculto, helpers) y se omiten los\n * estilos visuales (colores del label, borderRadius del input base).\n *\n * Usar cuando el consumer registra un preset de host: el preset asume el\n * control visual total, y los `styleOverrides` del host pueden actuar sin\n * ser bloqueados por los estilos inline de la librería.\n */\n layoutOnly?: boolean;\n}\n\nconst toRadius = (borderRadius: number | string) =>\n typeof borderRadius === 'number' ? `${borderRadius}px` : borderRadius;\n\n/**\n * Builder del sx compartido por todos los campos de formulario\n * (Input/Select/Autocomplete/DatePicker/DateTimePicker).\n *\n * Produce:\n * - en modo \"floating\": sólo el border-radius del outlined input;\n * - en modo \"outside\": todo el pack (margen superior, label flotante afuera,\n * input base, notched outline oculto, helper text sin margen izquierdo).\n *\n * Componentes con paddings o selectores propios pueden inyectarlos vía\n * `extraOutsideSx` / `extraFloatingSx`.\n */\nexport const buildFormFieldSx = ({\n borderRadius,\n labelPosition,\n includePickersApi = false,\n extraOutsideSx,\n extraFloatingSx,\n layoutOnly = false,\n}: BuildFormFieldSxOptions): SxProps<Theme> => {\n const radius = toRadius(borderRadius);\n\n // ── Selectores (alternan según la API de pickers) ────────────────────\n const outlinedRootSelector = includePickersApi\n ? '& .MuiOutlinedInput-root, & .MuiPickersOutlinedInput-root'\n : '& .MuiOutlinedInput-root';\n\n const inputBaseSelector = includePickersApi\n ? '& .MuiInputBase-root, & .MuiPickersInputBase-root'\n : '& .MuiInputBase-root';\n\n const notchedOutlineSelector = includePickersApi\n ? '& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline'\n : '& .MuiOutlinedInput-notchedOutline';\n\n // ── Floating ─────────────────────────────────────────────────────────\n if (labelPosition === 'floating') {\n return {\n // Visual borderRadius only when no preset — preset controls it when layoutOnly.\n ...(!layoutOnly && { [outlinedRootSelector]: { borderRadius: radius } }),\n ...(extraFloatingSx ?? {}),\n };\n }\n\n // ── Outside ──────────────────────────────────────────────────────────\n return {\n marginTop: LABEL_MARGIN_TOP,\n\n '& .MuiInputLabel-root': {\n // Visual label colors omitted when layoutOnly — host styleOverrides or preset handles them.\n ...(!layoutOnly && { color: LABEL_COLOR_REST }),\n transition: LABEL_TRANSITION,\n\n // Estado shrunk (focused o con valor): flota ARRIBA del input.\n '&.MuiInputLabel-shrink': {\n transform: LABEL_SHRINK_TRANSFORM,\n transformOrigin: LABEL_TRANSFORM_ORIGIN,\n ...(!layoutOnly && {\n color: LABEL_COLOR_FILLED,\n fontWeight: LABEL_FONT_WEIGHT_FILLED,\n }),\n },\n\n ...(!layoutOnly && { '&.Mui-focused': { color: LABEL_COLOR_FOCUSED } }),\n },\n\n // Input base — centra verticalmente (clásico y, si aplica, pickers).\n [inputBaseSelector]: {\n // Visual borderRadius omitted when layoutOnly — preset sets it on the root.\n ...(!layoutOnly && { borderRadius: radius }),\n display: 'flex',\n alignItems: 'center',\n },\n\n // El label flota afuera: ocultar legend del notch.\n [notchedOutlineSelector]: {\n top: 0,\n '& legend': { display: 'none' },\n },\n\n '& .MuiFormHelperText-root': {\n marginLeft: 0,\n },\n\n ...(extraOutsideSx ?? {}),\n };\n};\n"],"names":["LABEL_MARGIN_TOP","LABEL_COLOR_REST","LABEL_TRANSITION","LABEL_SHRINK_TRANSFORM","LABEL_TRANSFORM_ORIGIN","LABEL_COLOR_FILLED","LABEL_FONT_WEIGHT_FILLED","LABEL_COLOR_FOCUSED"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,WAAW,CAAC,iBAChB,OAAO,iBAAiB,WAAW,GAAG,YAAY,OAAO;AAcpD,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,aAAa;AACf,MAA+C;AAC7C,QAAM,SAAS,SAAS,YAAY;AAGpC,QAAM,uBAAuB,oBACzB,8DACA;AAEJ,QAAM,oBAAoB,oBACtB,sDACA;AAEJ,QAAM,yBAAyB,oBAC3B,kFACA;AAGJ,MAAI,kBAAkB,YAAY;AAChC,WAAO,kCAED,CAAC,cAAc,EAAE,CAAC,oBAAoB,GAAG,EAAE,cAAc,SAAO,IAChE,4CAAmB,CAAA;AAAA,EAE3B;AAGA,SAAO;AAAA,IACL,WAAWA,OAAAA;AAAAA,IAEX,yBAAyB,gDAEnB,CAAC,cAAc,EAAE,OAAOC,wBAAA,IAFL;AAAA,MAGvB,YAAYC,OAAAA;AAAAA;AAAAA,MAGZ,0BAA0B;AAAA,QACxB,WAAWC,OAAAA;AAAAA,QACX,iBAAiBC,OAAAA;AAAAA,SACb,CAAC,cAAc;AAAA,QACjB,OAAOC,OAAAA;AAAAA,QACP,YAAYC,OAAAA;AAAAA,MAAA;AAAA,QAIZ,CAAC,cAAc,EAAE,iBAAiB,EAAE,OAAOC,OAAAA,sBAAoB;AAAA;AAAA,IAIrE,CAAC,iBAAiB,GAAG,iCAEf,CAAC,cAAc,EAAE,cAAc,OAAA,IAFhB;AAAA,MAGnB,SAAS;AAAA,MACT,YAAY;AAAA,IAAA;AAAA;AAAA,IAId,CAAC,sBAAsB,GAAG;AAAA,MACxB,KAAK;AAAA,MACL,YAAY,EAAE,SAAS,OAAA;AAAA,IAAO;AAAA,IAGhC,6BAA6B;AAAA,MAC3B,YAAY;AAAA,IAAA;AAAA,KAGV,0CAAkB,CAAA;AAE1B;;"}
|