@astralui/core 0.1.13 → 0.1.14

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/index.d.cts CHANGED
@@ -148,8 +148,11 @@ interface Props {
148
148
  style?: CSSProperties;
149
149
  disabled?: boolean;
150
150
  'aria-label'?: string;
151
+ /** So a visible <label htmlFor> can name it. aria-label names the control
152
+ * too, but only htmlFor also makes clicking the label focus it. */
153
+ id?: string;
151
154
  }
152
- declare function DateInput({ type, value, onChange, min, max, className, style, disabled, 'aria-label': ariaLabel }: Props): react.JSX.Element;
155
+ declare function DateInput({ type, value, onChange, min, max, className, style, disabled, id, 'aria-label': ariaLabel }: Props): react.JSX.Element;
153
156
 
154
157
  declare function Spinner({ size, className, style }: {
155
158
  size?: number;
package/dist/index.d.ts CHANGED
@@ -148,8 +148,11 @@ interface Props {
148
148
  style?: CSSProperties;
149
149
  disabled?: boolean;
150
150
  'aria-label'?: string;
151
+ /** So a visible <label htmlFor> can name it. aria-label names the control
152
+ * too, but only htmlFor also makes clicking the label focus it. */
153
+ id?: string;
151
154
  }
152
- declare function DateInput({ type, value, onChange, min, max, className, style, disabled, 'aria-label': ariaLabel }: Props): react.JSX.Element;
155
+ declare function DateInput({ type, value, onChange, min, max, className, style, disabled, id, 'aria-label': ariaLabel }: Props): react.JSX.Element;
153
156
 
154
157
  declare function Spinner({ size, className, style }: {
155
158
  size?: number;
package/dist/index.js CHANGED
@@ -757,7 +757,7 @@ function dateTimeToInputStr(d) {
757
757
  if (!d || isNaN(d.getTime())) return "";
758
758
  return `${dateToInputStr(d)}T${pad2(d.getHours())}:${pad2(d.getMinutes())}`;
759
759
  }
760
- function DateInput({ type = "date", value, onChange, min, max, className, style, disabled, "aria-label": ariaLabel }) {
760
+ function DateInput({ type = "date", value, onChange, min, max, className, style, disabled, id, "aria-label": ariaLabel }) {
761
761
  const isTime = type === "datetime-local";
762
762
  const fmt = isTime ? dateTimeToInputStr : dateToInputStr;
763
763
  const [s, setS] = useState(() => fmt(value));
@@ -786,6 +786,7 @@ function DateInput({ type = "date", value, onChange, min, max, className, style,
786
786
  className,
787
787
  style,
788
788
  disabled,
789
+ id,
789
790
  "aria-label": ariaLabel,
790
791
  value: s,
791
792
  min: min ? fmt(min) : void 0,