From 7f2bf4db7429bf90ed0073f2a3fe52af403477bd Mon Sep 17 00:00:00 2001 From: JExcellence | Justin Date: Wed, 5 Nov 2025 12:39:10 +0100 Subject: [PATCH] fix(ui,docs): normalize `isOpen` handling + fix Input placeholder/label; tidy quotes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Normalize `isOpen` prop behavior across interactive components and docs/examples (consistent controlled/uncontrolled behavior, SSR-safe defaults). Touched: Dialog.tsx, DialogExample.tsx, dialog.mdx, DropdownWrapper.tsx, DropdownWrapperExample.tsx, dropdownWrapper.mdx, ContextMenu.tsx, Select.tsx, Kbar.tsx, ComponentsCheckPage.tsx - Input: resolve placeholder/label overlap + ID wiring - Correct label/placeholder interaction and focus/blur states - Ensure `htmlFor` ↔ `id` pairing; improve a11y (`aria-*`) - Styling tweaks in Input.module.scss; updated examples Touched: Input.module.scss, InputExamples.tsx, TextareaExamples.tsx - Misc cleanups - Quote consistency (`'` → `"` where needed), minor TS/prop nits - Example + demo updates (Countdown/Count/TypeFx, Date* pickers, CTA, Button, etc.) Touched: Accordion.tsx, Button.tsx, ChartHeader.tsx, CountdownFxExample.tsx, CountFxExample.tsx, Cta.tsx, DateInput.tsx, DatePicker.tsx, DatePickerExamples.tsx, DateRangeInput.tsx, emojiPickerDropdown.mdx, EmojiPickerDropdownExample.tsx, error.tsx, Select.tsx, ToastExample.tsx, TypeFxCustomExample.tsx No breaking changes expected. --- .../src/components/ComponentsCheckPage.tsx | 24 ++--- apps/docs/src/app/error.tsx | 8 +- .../src/content/once-ui/components/dialog.mdx | 12 +-- .../once-ui/components/dropdownWrapper.mdx | 10 +- .../components/emojiPickerDropdown.mdx | 2 +- apps/docs/src/product/CountFxExample.tsx | 39 ++++++-- apps/docs/src/product/CountdownFxExample.tsx | 28 ++++-- apps/docs/src/product/Cta.tsx | 92 +++++++++++++++---- apps/docs/src/product/DatePickerExamples.tsx | 46 +++------- apps/docs/src/product/DialogExample.tsx | 10 +- .../src/product/DropdownWrapperExample.tsx | 12 +-- .../product/EmojiPickerDropdownExample.tsx | 2 +- apps/docs/src/product/InputExamples.tsx | 26 +++--- apps/docs/src/product/TextareaExamples.tsx | 4 +- apps/docs/src/product/ToastExample.tsx | 24 +++-- apps/docs/src/product/TypeFxCustomExample.tsx | 11 ++- packages/core/src/components/Accordion.tsx | 2 +- packages/core/src/components/Button.tsx | 2 +- packages/core/src/components/ContextMenu.tsx | 10 +- packages/core/src/components/DateInput.tsx | 4 +- packages/core/src/components/DatePicker.tsx | 10 +- .../core/src/components/DateRangeInput.tsx | 2 +- packages/core/src/components/Dialog.tsx | 26 +++--- .../core/src/components/DropdownWrapper.tsx | 6 +- .../core/src/components/Input.module.scss | 12 +-- packages/core/src/components/Select.tsx | 2 +- .../core/src/modules/data/ChartHeader.tsx | 4 +- packages/core/src/modules/navigation/Kbar.tsx | 24 ++--- 28 files changed, 263 insertions(+), 191 deletions(-) diff --git a/apps/dev/src/components/ComponentsCheckPage.tsx b/apps/dev/src/components/ComponentsCheckPage.tsx index 66ff728..bb8a797 100644 --- a/apps/dev/src/components/ComponentsCheckPage.tsx +++ b/apps/dev/src/components/ComponentsCheckPage.tsx @@ -49,7 +49,6 @@ import { TagInput, Avatar, Background, - Input, Card, Chip, Fade, @@ -97,6 +96,7 @@ import { TypeFx, WeatherFx, CountdownFx, + Input, } from "@once-ui-system/core"; interface ComponentCategory { @@ -104,25 +104,12 @@ interface ComponentCategory { description: string; components: { name: string; - element: React.ReactNode; + element: React.ReactNode[] | React.ReactNode; }[]; } export default function ComponentsCheck() { const [selectedCategory, setSelectedCategory] = useState(null); - const [menuSelections, setMenuSelections] = useState>({}); - const [expandedComponents, setExpandedComponents] = useState>(new Set()); - - const toggleComponent = (componentName: string) => { - const newSet = new Set(expandedComponents); - if (newSet.has(componentName)) { - newSet.delete(componentName); - } else { - newSet.add(componentName); - } - setExpandedComponents(newSet); - }; - const categories: ComponentCategory[] = [ { name: "Layout", @@ -150,7 +137,11 @@ export default function ComponentsCheck() { components: [ { name: "Button", element: }, { name: "IconButton", element: }, - { name: "Input", element: }, + { name: "Input", element: [ + , + , + + ]}, { name: "Textarea", element: