@eylulg/ui 2.0.0 → 2.0.1
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/internal/Field.js
CHANGED
|
@@ -18,9 +18,10 @@ function FieldParts({ label, hint, errorMessage, isInvalid, children }) {
|
|
|
18
18
|
children: label
|
|
19
19
|
}),
|
|
20
20
|
children,
|
|
21
|
-
|
|
21
|
+
!shownError && /* @__PURE__ */ jsx(Text, {
|
|
22
22
|
slot: "description",
|
|
23
23
|
className: "text-sm text-tertiary",
|
|
24
|
+
hidden: !hint,
|
|
24
25
|
children: hint
|
|
25
26
|
}),
|
|
26
27
|
shownError ? /* @__PURE__ */ jsx(Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","names":["_Fragment"],"sources":["../../src/internal/Field.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { FieldError, Label, Text } from 'react-aria-components';\n\n/** The column every field shares: label, control, hint or error, 6px apart. */\nexport const fieldColumn = 'group flex flex-col gap-1.5';\n\nconst errorText = 'text-sm text-error';\n\ninterface FieldPartsProps {\n label?: ReactNode;\n hint?: ReactNode;\n errorMessage?: string;\n /** The field's own isInvalid prop: `false` hides the message even when one is set. */\n isInvalid?: boolean;\n children: ReactNode;\n}\n\n/**\n * Label, control, then the hint or the error: the order every field uses. The\n * hint gives way to the error. Without an `errorMessage`, FieldError shows\n * the browser's own validation message when there is one.\n */\nexport function FieldParts({ label, hint, errorMessage, isInvalid, children }: FieldPartsProps) {\n const shownError = (isInvalid ?? Boolean(errorMessage)) ? errorMessage : undefined;\n return (\n <>\n {label && <Label className='text-sm font-medium text-secondary'>{label}</Label>}\n {children}\n {hint
|
|
1
|
+
{"version":3,"file":"Field.js","names":["_Fragment"],"sources":["../../src/internal/Field.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { FieldError, Label, Text } from 'react-aria-components';\n\n/** The column every field shares: label, control, hint or error, 6px apart. */\nexport const fieldColumn = 'group flex flex-col gap-1.5';\n\nconst errorText = 'text-sm text-error';\n\ninterface FieldPartsProps {\n label?: ReactNode;\n hint?: ReactNode;\n errorMessage?: string;\n /** The field's own isInvalid prop: `false` hides the message even when one is set. */\n isInvalid?: boolean;\n children: ReactNode;\n}\n\n/**\n * Label, control, then the hint or the error: the order every field uses. The\n * hint gives way to the error. Without an `errorMessage`, FieldError shows\n * the browser's own validation message when there is one.\n */\nexport function FieldParts({ label, hint, errorMessage, isInvalid, children }: FieldPartsProps) {\n const shownError = (isInvalid ?? Boolean(errorMessage)) ? errorMessage : undefined;\n return (\n <>\n {label && <Label className='text-sm font-medium text-secondary'>{label}</Label>}\n {children}\n {/* Rendered even without a hint: React Aria looks the description up again only when the\n error state changes, so a hint that appeared later was never linked to the control. */}\n {!shownError && (\n <Text slot='description' className='text-sm text-tertiary' hidden={!hint}>\n {hint}\n </Text>\n )}\n {shownError ? (\n <Text slot='errorMessage' className={errorText}>\n {shownError}\n </Text>\n ) : (\n <FieldError className={errorText} />\n )}\n </>\n );\n}\n"],"mappings":";;;;;AAIA,IAAa,cAAc;AAE3B,IAAM,YAAY;;;;;;AAgBlB,SAAgB,WAAW,EAAE,OAAO,MAAM,cAAc,WAAW,YAA6B;CAC9F,MAAM,aAAc,aAAa,QAAQ,YAAY,IAAK,eAAe,KAAA;CACzE,OACE,qBAAAA,UAAA,EAAA,UAAA;EACG,SAAS,oBAAC,OAAD;GAAO,WAAU;GAAsC,UAAA;EAAa,CAAA;EAC7E;EAGA,CAAC,cACA,oBAAC,MAAD;GAAM,MAAK;GAAc,WAAU;GAAwB,QAAQ,CAAC;GACjE,UAAA;EACG,CAAA;EAEP,aACC,oBAAC,MAAD;GAAM,MAAK;GAAe,WAAW;GAClC,UAAA;EACG,CAAA,IAEN,oBAAC,YAAD,EAAY,WAAW,UAAY,CAAA;CAErC,EAAA,CAAA;AAEN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eylulg/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Accessible React 19 design system built with atomic design on React Aria Components and Tailwind CSS 4 tokens.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Eylül Güneş (https://github.com/eylulg)",
|