@knk1313/plain-ui 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +86 -2
- package/dist/components/accordion/Accordion.d.ts +27 -0
- package/dist/components/accordion/Accordion.js +18 -0
- package/dist/components/accordion/index.d.ts +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/agent-form/AgentForm.d.ts +40 -0
- package/dist/components/agent-form/AgentForm.js +100 -0
- package/dist/components/agent-form/index.d.ts +1 -0
- package/dist/components/agent-form/index.js +1 -0
- package/dist/components/agent-steps/AgentSteps.d.ts +21 -0
- package/dist/components/agent-steps/AgentSteps.js +42 -0
- package/dist/components/agent-steps/index.d.ts +1 -0
- package/dist/components/agent-steps/index.js +1 -0
- package/dist/components/agent-thinking/AgentThinking.d.ts +12 -0
- package/dist/components/agent-thinking/AgentThinking.js +18 -0
- package/dist/components/agent-thinking/index.d.ts +1 -0
- package/dist/components/agent-thinking/index.js +1 -0
- package/dist/components/area-chart/AreaChart.d.ts +10 -0
- package/dist/components/area-chart/AreaChart.js +83 -0
- package/dist/components/area-chart/index.d.ts +1 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/auth-card/AuthCard.d.ts +14 -0
- package/dist/components/auth-card/AuthCard.js +9 -0
- package/dist/components/auth-card/PasswordInput.d.ts +13 -0
- package/dist/components/auth-card/PasswordInput.js +26 -0
- package/dist/components/auth-card/index.d.ts +2 -0
- package/dist/components/auth-card/index.js +2 -0
- package/dist/components/avatar/Avatar.d.ts +14 -0
- package/dist/components/avatar/Avatar.js +42 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/Badge.d.ts +9 -0
- package/dist/components/badge/Badge.js +15 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/banner/Banner.d.ts +9 -0
- package/dist/components/banner/Banner.js +36 -0
- package/dist/components/banner/index.d.ts +1 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/bar-chart/BarChart.d.ts +3 -0
- package/dist/components/bar-chart/BarChart.js +47 -0
- package/dist/components/bar-chart/index.d.ts +1 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/bar-list/BarList.d.ts +26 -0
- package/dist/components/bar-list/BarList.js +24 -0
- package/dist/components/bar-list/index.d.ts +1 -0
- package/dist/components/bar-list/index.js +1 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb/Breadcrumb.js +9 -0
- package/dist/components/breadcrumb/index.d.ts +1 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/button/Button.d.ts +24 -0
- package/dist/components/button/Button.js +31 -0
- package/dist/components/button/buttonStyle.d.ts +9 -0
- package/dist/components/button/buttonStyle.js +41 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +18 -0
- package/dist/components/button-group/ButtonGroup.js +26 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/calendar/Calendar.d.ts +20 -0
- package/dist/components/calendar/Calendar.js +98 -0
- package/dist/components/calendar/index.d.ts +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/calendar-view/CalendarView.d.ts +34 -0
- package/dist/components/calendar-view/CalendarView.js +111 -0
- package/dist/components/calendar-view/index.d.ts +1 -0
- package/dist/components/calendar-view/index.js +1 -0
- package/dist/components/card/Card.d.ts +6 -0
- package/dist/components/card/Card.js +6 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/carousel/Carousel.d.ts +18 -0
- package/dist/components/carousel/Carousel.js +58 -0
- package/dist/components/carousel/index.d.ts +1 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/chart/Axis.d.ts +51 -0
- package/dist/components/chart/Axis.js +127 -0
- package/dist/components/chart/ChartFrame.d.ts +79 -0
- package/dist/components/chart/ChartFrame.js +80 -0
- package/dist/components/chart/ChartTooltip.d.ts +12 -0
- package/dist/components/chart/ChartTooltip.js +57 -0
- package/dist/components/chart/Legend.d.ts +11 -0
- package/dist/components/chart/Legend.js +6 -0
- package/dist/components/chart/Sparkline.d.ts +5 -0
- package/dist/components/chart/Sparkline.js +20 -0
- package/dist/components/chart/format.d.ts +2 -0
- package/dist/components/chart/format.js +17 -0
- package/dist/components/chart/heatmap.d.ts +18 -0
- package/dist/components/chart/heatmap.js +47 -0
- package/dist/components/chart/index.d.ts +1 -0
- package/dist/components/chart/index.js +1 -0
- package/dist/components/chart/line.d.ts +1 -0
- package/dist/components/chart/line.js +15 -0
- package/dist/components/chart/scale.d.ts +15 -0
- package/dist/components/chart/scale.js +100 -0
- package/dist/components/chart/series.d.ts +44 -0
- package/dist/components/chart/series.js +86 -0
- package/dist/components/chart/spacing.d.ts +29 -0
- package/dist/components/chart/spacing.js +34 -0
- package/dist/components/chart/types.d.ts +29 -0
- package/dist/components/chart/types.js +2 -0
- package/dist/components/chart/useChartHover.d.ts +34 -0
- package/dist/components/chart/useChartHover.js +97 -0
- package/dist/components/checkbox/Checkbox.d.ts +10 -0
- package/dist/components/checkbox/Checkbox.js +38 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/Chip.d.ts +21 -0
- package/dist/components/chip/Chip.js +10 -0
- package/dist/components/chip/index.d.ts +1 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/close-button/CloseButton.d.ts +14 -0
- package/dist/components/close-button/CloseButton.js +9 -0
- package/dist/components/close-button/index.d.ts +1 -0
- package/dist/components/close-button/index.js +1 -0
- package/dist/components/color-picker/ColorPicker.d.ts +21 -0
- package/dist/components/color-picker/ColorPicker.js +20 -0
- package/dist/components/color-picker/index.d.ts +1 -0
- package/dist/components/color-picker/index.js +1 -0
- package/dist/components/combo-chart/ComboChart.d.ts +12 -0
- package/dist/components/combo-chart/ComboChart.js +84 -0
- package/dist/components/combo-chart/index.d.ts +1 -0
- package/dist/components/combo-chart/index.js +1 -0
- package/dist/components/combobox/Combobox.d.ts +33 -0
- package/dist/components/combobox/Combobox.js +246 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/command-palette/CommandPalette.d.ts +36 -0
- package/dist/components/command-palette/CommandPalette.js +156 -0
- package/dist/components/command-palette/index.d.ts +1 -0
- package/dist/components/command-palette/index.js +1 -0
- package/dist/components/composer/Composer.d.ts +32 -0
- package/dist/components/composer/Composer.js +101 -0
- package/dist/components/composer/index.d.ts +1 -0
- package/dist/components/composer/index.js +1 -0
- package/dist/components/composer-attachments/ComposerAttachments.d.ts +25 -0
- package/dist/components/composer-attachments/ComposerAttachments.js +52 -0
- package/dist/components/composer-attachments/index.d.ts +1 -0
- package/dist/components/composer-attachments/index.js +1 -0
- package/dist/components/composer-panel/ComposerPanel.d.ts +26 -0
- package/dist/components/composer-panel/ComposerPanel.js +154 -0
- package/dist/components/composer-panel/index.d.ts +1 -0
- package/dist/components/composer-panel/index.js +1 -0
- package/dist/components/contribution-chart/ContributionChart.d.ts +25 -0
- package/dist/components/contribution-chart/ContributionChart.js +127 -0
- package/dist/components/contribution-chart/index.d.ts +1 -0
- package/dist/components/contribution-chart/index.js +1 -0
- package/dist/components/data-grid/DataGrid.d.ts +40 -0
- package/dist/components/data-grid/DataGrid.js +157 -0
- package/dist/components/data-grid/index.d.ts +1 -0
- package/dist/components/data-grid/index.js +1 -0
- package/dist/components/data-table/DataTable.d.ts +87 -0
- package/dist/components/data-table/DataTable.js +150 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +2 -0
- package/dist/components/data-table/query.d.ts +54 -0
- package/dist/components/data-table/query.js +70 -0
- package/dist/components/date-picker/DatePicker.d.ts +25 -0
- package/dist/components/date-picker/DatePicker.js +154 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/dialog/ConfirmDialog.d.ts +25 -0
- package/dist/components/dialog/ConfirmDialog.js +69 -0
- package/dist/components/dialog/Dialog.d.ts +25 -0
- package/dist/components/dialog/Dialog.js +11 -0
- package/dist/components/dialog/DialogFrame.d.ts +22 -0
- package/dist/components/dialog/DialogFrame.js +21 -0
- package/dist/components/dialog/DiscardChangesDialog.d.ts +10 -0
- package/dist/components/dialog/DiscardChangesDialog.js +10 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dialog/useDiscardOnClose.d.ts +20 -0
- package/dist/components/dialog/useDiscardOnClose.js +26 -0
- package/dist/components/dialog/useModalDialog.d.ts +20 -0
- package/dist/components/dialog/useModalDialog.js +85 -0
- package/dist/components/drawer/Drawer.d.ts +14 -0
- package/dist/components/drawer/Drawer.js +22 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/empty-state/EmptyState.d.ts +11 -0
- package/dist/components/empty-state/EmptyState.js +7 -0
- package/dist/components/empty-state/index.d.ts +1 -0
- package/dist/components/empty-state/index.js +1 -0
- package/dist/components/error-state/ErrorState.d.ts +8 -0
- package/dist/components/error-state/ErrorState.js +7 -0
- package/dist/components/error-state/index.d.ts +1 -0
- package/dist/components/error-state/index.js +1 -0
- package/dist/components/error-summary/ErrorSummary.d.ts +21 -0
- package/dist/components/error-summary/ErrorSummary.js +16 -0
- package/dist/components/error-summary/index.d.ts +1 -0
- package/dist/components/error-summary/index.js +1 -0
- package/dist/components/field/Field.d.ts +23 -0
- package/dist/components/field/Field.js +20 -0
- package/dist/components/field/index.d.ts +1 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/field-error/FieldError.d.ts +10 -0
- package/dist/components/field-error/FieldError.js +52 -0
- package/dist/components/field-error/index.d.ts +1 -0
- package/dist/components/field-error/index.js +1 -0
- package/dist/components/file-upload/FileUpload.d.ts +50 -0
- package/dist/components/file-upload/FileUpload.js +169 -0
- package/dist/components/file-upload/fileSize.d.ts +1 -0
- package/dist/components/file-upload/fileSize.js +13 -0
- package/dist/components/file-upload/index.d.ts +1 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/form-section/FormSection.d.ts +16 -0
- package/dist/components/form-section/FormSection.js +14 -0
- package/dist/components/form-section/index.d.ts +1 -0
- package/dist/components/form-section/index.js +1 -0
- package/dist/components/form-steps/FormSteps.d.ts +18 -0
- package/dist/components/form-steps/FormSteps.js +26 -0
- package/dist/components/form-steps/index.d.ts +1 -0
- package/dist/components/form-steps/index.js +1 -0
- package/dist/components/funnel-chart/FunnelChart.d.ts +12 -0
- package/dist/components/funnel-chart/FunnelChart.js +69 -0
- package/dist/components/funnel-chart/index.d.ts +1 -0
- package/dist/components/funnel-chart/index.js +1 -0
- package/dist/components/header/Header.d.ts +14 -0
- package/dist/components/header/Header.js +31 -0
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/header/index.js +1 -0
- package/dist/components/heatmap-chart/HeatmapChart.d.ts +10 -0
- package/dist/components/heatmap-chart/HeatmapChart.js +76 -0
- package/dist/components/heatmap-chart/index.d.ts +1 -0
- package/dist/components/heatmap-chart/index.js +1 -0
- package/dist/components/image-error/ImageError.d.ts +11 -0
- package/dist/components/image-error/ImageError.js +16 -0
- package/dist/components/image-error/index.d.ts +1 -0
- package/dist/components/image-error/index.js +1 -0
- package/dist/components/image-loader/ImageLoader.d.ts +9 -0
- package/dist/components/image-loader/ImageLoader.js +10 -0
- package/dist/components/image-loader/index.d.ts +1 -0
- package/dist/components/image-loader/index.js +1 -0
- package/dist/components/index.d.ts +98 -0
- package/dist/components/index.js +97 -0
- package/dist/components/input/Input.d.ts +6 -0
- package/dist/components/input/Input.js +8 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/inputStyle.d.ts +14 -0
- package/dist/components/input/inputStyle.js +35 -0
- package/dist/components/item-range/ItemRange.d.ts +11 -0
- package/dist/components/item-range/ItemRange.js +13 -0
- package/dist/components/item-range/index.d.ts +1 -0
- package/dist/components/item-range/index.js +1 -0
- package/dist/components/label/Label.d.ts +8 -0
- package/dist/components/label/Label.js +5 -0
- package/dist/components/label/index.d.ts +1 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/line-chart/LineChart.d.ts +10 -0
- package/dist/components/line-chart/LineChart.js +29 -0
- package/dist/components/line-chart/index.d.ts +1 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/link-button/LinkButton.d.ts +29 -0
- package/dist/components/link-button/LinkButton.js +15 -0
- package/dist/components/link-button/index.d.ts +1 -0
- package/dist/components/link-button/index.js +1 -0
- package/dist/components/menu/Menu.d.ts +33 -0
- package/dist/components/menu/Menu.js +113 -0
- package/dist/components/menu/index.d.ts +1 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/meter/Meter.d.ts +24 -0
- package/dist/components/meter/Meter.js +65 -0
- package/dist/components/meter/index.d.ts +1 -0
- package/dist/components/meter/index.js +1 -0
- package/dist/components/nav-group/NavGroup.d.ts +24 -0
- package/dist/components/nav-group/NavGroup.js +23 -0
- package/dist/components/nav-group/index.d.ts +1 -0
- package/dist/components/nav-group/index.js +1 -0
- package/dist/components/notification/Notification.d.ts +25 -0
- package/dist/components/notification/Notification.js +13 -0
- package/dist/components/notification/index.d.ts +1 -0
- package/dist/components/notification/index.js +1 -0
- package/dist/components/notification-center/NotificationCenter.d.ts +33 -0
- package/dist/components/notification-center/NotificationCenter.js +29 -0
- package/dist/components/notification-center/index.d.ts +1 -0
- package/dist/components/notification-center/index.js +1 -0
- package/dist/components/number-field/NumberField.d.ts +28 -0
- package/dist/components/number-field/NumberField.js +155 -0
- package/dist/components/number-field/index.d.ts +1 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/otp-input/OtpInput.d.ts +14 -0
- package/dist/components/otp-input/OtpInput.js +70 -0
- package/dist/components/otp-input/index.d.ts +1 -0
- package/dist/components/otp-input/index.js +1 -0
- package/dist/components/pagination/Pagination.d.ts +21 -0
- package/dist/components/pagination/Pagination.js +51 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/popover/Popover.d.ts +23 -0
- package/dist/components/popover/Popover.js +83 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/progress/Progress.d.ts +12 -0
- package/dist/components/progress/Progress.js +30 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/index.js +1 -0
- package/dist/components/question-form/QuestionForm.d.ts +59 -0
- package/dist/components/question-form/QuestionForm.js +128 -0
- package/dist/components/question-form/index.d.ts +1 -0
- package/dist/components/question-form/index.js +1 -0
- package/dist/components/radar-chart/RadarChart.d.ts +3 -0
- package/dist/components/radar-chart/RadarChart.js +72 -0
- package/dist/components/radar-chart/geometry.d.ts +16 -0
- package/dist/components/radar-chart/geometry.js +56 -0
- package/dist/components/radar-chart/index.d.ts +1 -0
- package/dist/components/radar-chart/index.js +1 -0
- package/dist/components/radial-chart/RadialChart.d.ts +39 -0
- package/dist/components/radial-chart/RadialChart.js +135 -0
- package/dist/components/radial-chart/index.d.ts +1 -0
- package/dist/components/radial-chart/index.js +1 -0
- package/dist/components/radio/Radio.d.ts +31 -0
- package/dist/components/radio/Radio.js +24 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/index.js +1 -0
- package/dist/components/reply-loader/ReplyLoader.d.ts +10 -0
- package/dist/components/reply-loader/ReplyLoader.js +9 -0
- package/dist/components/reply-loader/index.d.ts +1 -0
- package/dist/components/reply-loader/index.js +1 -0
- package/dist/components/sankey-chart/SankeyChart.d.ts +35 -0
- package/dist/components/sankey-chart/SankeyChart.js +218 -0
- package/dist/components/sankey-chart/index.d.ts +1 -0
- package/dist/components/sankey-chart/index.js +1 -0
- package/dist/components/scatter-chart/ScatterChart.d.ts +38 -0
- package/dist/components/scatter-chart/ScatterChart.js +69 -0
- package/dist/components/scatter-chart/index.d.ts +1 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/search-field/SearchField.d.ts +17 -0
- package/dist/components/search-field/SearchField.js +92 -0
- package/dist/components/search-field/index.d.ts +1 -0
- package/dist/components/search-field/index.js +1 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +26 -0
- package/dist/components/segmented-control/SegmentedControl.js +38 -0
- package/dist/components/segmented-control/index.d.ts +1 -0
- package/dist/components/segmented-control/index.js +1 -0
- package/dist/components/select/Select.d.ts +11 -0
- package/dist/components/select/Select.js +30 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/separator/Separator.d.ts +14 -0
- package/dist/components/separator/Separator.js +12 -0
- package/dist/components/separator/index.d.ts +1 -0
- package/dist/components/separator/index.js +1 -0
- package/dist/components/settings-modal/SettingsModal.d.ts +35 -0
- package/dist/components/settings-modal/SettingsModal.js +120 -0
- package/dist/components/settings-modal/index.d.ts +1 -0
- package/dist/components/settings-modal/index.js +1 -0
- package/dist/components/sidebar/Sidebar.d.ts +30 -0
- package/dist/components/sidebar/Sidebar.js +30 -0
- package/dist/components/sidebar/index.d.ts +1 -0
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/skeleton/Skeleton.d.ts +6 -0
- package/dist/components/skeleton/Skeleton.js +6 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skip-link/SkipLink.d.ts +8 -0
- package/dist/components/skip-link/SkipLink.js +10 -0
- package/dist/components/skip-link/index.d.ts +1 -0
- package/dist/components/skip-link/index.js +1 -0
- package/dist/components/slider/Slider.d.ts +19 -0
- package/dist/components/slider/Slider.js +49 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/spinner/Spinner.d.ts +5 -0
- package/dist/components/spinner/Spinner.js +7 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/stacked-bar/StackedBar.d.ts +29 -0
- package/dist/components/stacked-bar/StackedBar.js +77 -0
- package/dist/components/stacked-bar/index.d.ts +1 -0
- package/dist/components/stacked-bar/index.js +1 -0
- package/dist/components/stat-card/StatCard.d.ts +19 -0
- package/dist/components/stat-card/StatCard.js +32 -0
- package/dist/components/stat-card/index.d.ts +1 -0
- package/dist/components/stat-card/index.js +1 -0
- package/dist/components/switch/Switch.d.ts +10 -0
- package/dist/components/switch/Switch.js +22 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/SortableHeader.d.ts +12 -0
- package/dist/components/table/SortableHeader.js +11 -0
- package/dist/components/table/Table.d.ts +15 -0
- package/dist/components/table/Table.js +26 -0
- package/dist/components/table/align.d.ts +1 -0
- package/dist/components/table/align.js +5 -0
- package/dist/components/table/index.d.ts +4 -0
- package/dist/components/table/index.js +2 -0
- package/dist/components/tabs/Tabs.d.ts +38 -0
- package/dist/components/tabs/Tabs.js +137 -0
- package/dist/components/tabs/fitTabs.d.ts +18 -0
- package/dist/components/tabs/fitTabs.js +46 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/tag-group/TagGroup.d.ts +29 -0
- package/dist/components/tag-group/TagGroup.js +82 -0
- package/dist/components/tag-group/index.d.ts +1 -0
- package/dist/components/tag-group/index.js +1 -0
- package/dist/components/task-list/TaskList.d.ts +46 -0
- package/dist/components/task-list/TaskList.js +30 -0
- package/dist/components/task-list/index.d.ts +1 -0
- package/dist/components/task-list/index.js +1 -0
- package/dist/components/text-link/TextLink.d.ts +27 -0
- package/dist/components/text-link/TextLink.js +22 -0
- package/dist/components/text-link/index.d.ts +1 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/textarea/Textarea.d.ts +6 -0
- package/dist/components/textarea/Textarea.js +9 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/time-field/TimeField.d.ts +6 -0
- package/dist/components/time-field/TimeField.js +9 -0
- package/dist/components/time-field/index.d.ts +1 -0
- package/dist/components/time-field/index.js +1 -0
- package/dist/components/toast/Toast.d.ts +19 -0
- package/dist/components/toast/Toast.js +190 -0
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/token-input/TokenInput.d.ts +27 -0
- package/dist/components/token-input/TokenInput.js +153 -0
- package/dist/components/token-input/index.d.ts +1 -0
- package/dist/components/token-input/index.js +1 -0
- package/dist/components/tooltip/Tooltip.d.ts +17 -0
- package/dist/components/tooltip/Tooltip.js +144 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tree-view/TreeView.d.ts +29 -0
- package/dist/components/tree-view/TreeView.js +140 -0
- package/dist/components/tree-view/index.d.ts +1 -0
- package/dist/components/tree-view/index.js +1 -0
- package/dist/components/unsaved-changes/index.d.ts +1 -0
- package/dist/components/unsaved-changes/index.js +1 -0
- package/dist/components/unsaved-changes/useUnsavedChanges.d.ts +12 -0
- package/dist/components/unsaved-changes/useUnsavedChanges.js +45 -0
- package/dist/components/usage-limit/UsageLimit.d.ts +15 -0
- package/dist/components/usage-limit/UsageLimit.js +21 -0
- package/dist/components/usage-limit/index.d.ts +1 -0
- package/dist/components/usage-limit/index.js +1 -0
- package/dist/components/web-search-results/WebSearchResults.d.ts +21 -0
- package/dist/components/web-search-results/WebSearchResults.js +17 -0
- package/dist/components/web-search-results/index.d.ts +1 -0
- package/dist/components/web-search-results/index.js +1 -0
- package/dist/lib/anchor.d.ts +21 -0
- package/dist/lib/anchor.js +50 -0
- package/dist/lib/cn.d.ts +1 -0
- package/dist/lib/cn.js +5 -0
- package/dist/lib/date.d.ts +77 -0
- package/dist/lib/date.js +165 -0
- package/dist/lib/icon-message.d.ts +16 -0
- package/dist/lib/icon-message.js +7 -0
- package/dist/lib/number.d.ts +1 -0
- package/dist/lib/number.js +5 -0
- package/dist/lib/slot.d.ts +8 -0
- package/dist/lib/slot.js +53 -0
- package/dist/lib/variant.d.ts +1 -0
- package/dist/lib/variant.js +1 -0
- package/docs/a11y.md +320 -0
- package/docs/chart/axis.md +82 -0
- package/docs/chart/color.md +120 -0
- package/docs/chart/drawing.md +283 -0
- package/docs/chart/reading.md +79 -0
- package/docs/chart/size-and-spacing.md +85 -0
- package/docs/chart.md +47 -0
- package/docs/color/contrast.md +80 -0
- package/docs/color/data-viz.md +66 -0
- package/docs/color/foundation.md +91 -0
- package/docs/color/neutral.md +88 -0
- package/docs/color/state.md +111 -0
- package/docs/color.md +22 -0
- package/docs/components/accordion.md +51 -0
- package/docs/components/agent-form.md +56 -0
- package/docs/components/agent-steps.md +75 -0
- package/docs/components/agent-thinking.md +70 -0
- package/docs/components/area-chart.md +55 -0
- package/docs/components/auth-card.md +126 -0
- package/docs/components/avatar.md +38 -0
- package/docs/components/badge.md +28 -0
- package/docs/components/banner.md +19 -0
- package/docs/components/bar-list.md +77 -0
- package/docs/components/button-group.md +74 -0
- package/docs/components/button.md +49 -0
- package/docs/components/calendar-view.md +106 -0
- package/docs/components/calendar.md +44 -0
- package/docs/components/carousel.md +81 -0
- package/docs/components/chart.md +45 -0
- package/docs/components/chat-message.md +199 -0
- package/docs/components/checkbox.md +27 -0
- package/docs/components/chip.md +34 -0
- package/docs/components/choosing.md +26 -0
- package/docs/components/close-button.md +17 -0
- package/docs/components/color-picker.md +52 -0
- package/docs/components/combo-chart.md +74 -0
- package/docs/components/combobox.md +60 -0
- package/docs/components/command-palette.md +151 -0
- package/docs/components/composer-attachments.md +116 -0
- package/docs/components/composer-panel.md +106 -0
- package/docs/components/composer.md +163 -0
- package/docs/components/contribution-chart.md +70 -0
- package/docs/components/data-grid.md +132 -0
- package/docs/components/data-table.md +165 -0
- package/docs/components/date-picker.md +120 -0
- package/docs/components/dialog.md +211 -0
- package/docs/components/drawer.md +38 -0
- package/docs/components/empty-state.md +17 -0
- package/docs/components/error-state.md +13 -0
- package/docs/components/error-summary.md +49 -0
- package/docs/components/field.md +84 -0
- package/docs/components/file-upload.md +161 -0
- package/docs/components/focus.md +25 -0
- package/docs/components/form-section.md +49 -0
- package/docs/components/form-steps.md +63 -0
- package/docs/components/funnel-chart.md +49 -0
- package/docs/components/heatmap-chart.md +64 -0
- package/docs/components/image-error.md +73 -0
- package/docs/components/image-loader.md +53 -0
- package/docs/components/input.md +21 -0
- package/docs/components/item-range.md +10 -0
- package/docs/components/link-button.md +16 -0
- package/docs/components/menu.md +115 -0
- package/docs/components/meter.md +83 -0
- package/docs/components/nav-group.md +33 -0
- package/docs/components/notification-center.md +100 -0
- package/docs/components/notification.md +127 -0
- package/docs/components/number-field.md +128 -0
- package/docs/components/otp-input.md +86 -0
- package/docs/components/pagination.md +29 -0
- package/docs/components/popover.md +43 -0
- package/docs/components/progress.md +25 -0
- package/docs/components/prohibitions.md +58 -0
- package/docs/components/props.md +20 -0
- package/docs/components/question-form.md +125 -0
- package/docs/components/radar-chart.md +61 -0
- package/docs/components/radial-chart.md +74 -0
- package/docs/components/radio.md +24 -0
- package/docs/components/reply-loader.md +80 -0
- package/docs/components/sankey-chart.md +71 -0
- package/docs/components/scatter-chart.md +61 -0
- package/docs/components/search-field.md +44 -0
- package/docs/components/segmented-control.md +35 -0
- package/docs/components/select.md +28 -0
- package/docs/components/separator.md +23 -0
- package/docs/components/settings-modal.md +128 -0
- package/docs/components/sidebar.md +145 -0
- package/docs/components/skeleton.md +27 -0
- package/docs/components/skip-link.md +17 -0
- package/docs/components/slider.md +82 -0
- package/docs/components/spinner.md +8 -0
- package/docs/components/stacked-bar.md +66 -0
- package/docs/components/stat-card.md +78 -0
- package/docs/components/switch.md +61 -0
- package/docs/components/table.md +43 -0
- package/docs/components/tabs.md +104 -0
- package/docs/components/tag-group.md +115 -0
- package/docs/components/task-list.md +99 -0
- package/docs/components/text-link.md +17 -0
- package/docs/components/textarea.md +27 -0
- package/docs/components/time-field.md +97 -0
- package/docs/components/toast.md +73 -0
- package/docs/components/token-input.md +135 -0
- package/docs/components/tooltip.md +41 -0
- package/docs/components/tree-view.md +71 -0
- package/docs/components/usage-limit.md +47 -0
- package/docs/components/web-search-results.md +60 -0
- package/docs/components.md +234 -0
- package/docs/design.md +31 -0
- package/docs/form/clearing-errors.md +28 -0
- package/docs/form/error-announcement.md +69 -0
- package/docs/form/long-forms.md +103 -0
- package/docs/form/placeholder.md +40 -0
- package/docs/form/submit-errors.md +102 -0
- package/docs/form/submitting.md +72 -0
- package/docs/form/unsaved-changes.md +146 -0
- package/docs/form/validation-timing.md +44 -0
- package/docs/form.md +39 -0
- package/docs/glossary.md +169 -0
- package/docs/icon.md +245 -0
- package/docs/interaction/before.md +64 -0
- package/docs/interaction/motion.md +38 -0
- package/docs/interaction/pending.md +38 -0
- package/docs/interaction/permissions.md +133 -0
- package/docs/interaction/result.md +38 -0
- package/docs/interaction/states.md +159 -0
- package/docs/interaction.md +31 -0
- package/docs/layout/alignment.md +145 -0
- package/docs/layout/hit-area.md +58 -0
- package/docs/layout/mobile.md +200 -0
- package/docs/layout/responsive.md +73 -0
- package/docs/layout/scroll.md +51 -0
- package/docs/layout/surface.md +110 -0
- package/docs/layout.md +31 -0
- package/docs/list/board.md +85 -0
- package/docs/list/paging.md +146 -0
- package/docs/list/search.md +98 -0
- package/docs/list/toolbar.md +91 -0
- package/docs/list.md +39 -0
- package/docs/log.md +94 -0
- package/docs/manual.md +183 -0
- package/docs/navigation/header-and-transition.md +82 -0
- package/docs/navigation/location.md +68 -0
- package/docs/navigation/menu-items.md +152 -0
- package/docs/navigation/menu-structure.md +68 -0
- package/docs/navigation.md +23 -0
- package/docs/publish.md +26 -0
- package/docs/rules.md +246 -0
- package/docs/scenario.md +218 -0
- package/docs/spacing/placement.md +219 -0
- package/docs/spacing/radius.md +45 -0
- package/docs/spacing/scale.md +91 -0
- package/docs/spacing.md +17 -0
- package/docs/typography.md +233 -0
- package/docs/writing/date-and-number.md +25 -0
- package/docs/writing/error-and-empty.md +58 -0
- package/docs/writing/label-and-button.md +124 -0
- package/docs/writing/tone.md +156 -0
- package/docs/writing.md +27 -0
- package/icons/index.d.ts +1 -0
- package/icons/index.js +3 -0
- package/package.json +117 -4
- package/scripts/lint/colors.mjs +103 -0
- package/scripts/lint/deps.mjs +33 -0
- package/scripts/lint/icons.mjs +177 -0
- package/scripts/lint/interaction.mjs +163 -0
- package/scripts/lint/layout.mjs +103 -0
- package/scripts/lint/markup.mjs +271 -0
- package/scripts/lint/shared.mjs +340 -0
- package/scripts/lint/spacing.mjs +70 -0
- package/scripts/lint/typography.mjs +141 -0
- package/scripts/lint/writing.mjs +107 -0
- package/scripts/lint.mjs +166 -0
- package/scripts/plain-ui-lint.mjs +33 -0
- package/tokens/tokens.css +482 -0
- package/tokens/tokens.values.json +234 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# グラフの系列
|
|
2
|
+
|
|
3
|
+
グラフの線、棒、印を、系列ごとに描き分ける色。1つ目の系列は白黒にし、系列が1つだけのグラフは白黒で描く。2つ目からは、ブルー、オレンジ、パープル、グリーンの順に使う。アクセントの色を選んでも変わらない。
|
|
4
|
+
|
|
5
|
+
| トークン | 用途 | Tailwindクラス |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| `chart-1` | グラフの1つ目の系列。白黒の線、棒、印 | `stroke-chart-1`、`fill-chart-1`、`bg-chart-1` |
|
|
8
|
+
| `chart-2` | グラフの2つ目の系列。ブルーの線、棒、印 | `stroke-chart-2`、`fill-chart-2`、`bg-chart-2` |
|
|
9
|
+
| `chart-3` | グラフの3つ目の系列。オレンジの線、棒、印 | `stroke-chart-3`、`fill-chart-3`、`bg-chart-3` |
|
|
10
|
+
| `chart-4` | グラフの4つ目の系列。パープルの線、棒、印 | `stroke-chart-4`、`fill-chart-4`、`bg-chart-4` |
|
|
11
|
+
| `chart-5` | グラフの5つ目の系列。グリーンの線、棒、印 | `stroke-chart-5`、`fill-chart-5`、`bg-chart-5` |
|
|
12
|
+
|
|
13
|
+
どの色も、`background`、`card`、`popover`、`muted` との比を、ライトモードとダークモードの両方で3:1以上にする。2つ目から5つ目の色は明るさがほぼ同じなので、色の違いだけでは見分けにくい。系列は、線の種類、印の形、棒の模様でも描き分ける([chart.md](../chart.md))。
|
|
14
|
+
|
|
15
|
+
系列の色を、状態の色(`danger-solid` など)で代えない。状態の色を系列に使うと、系列が成功やエラーを示しているように読める。系列が6つ以上になるグラフは作らず、系列を分けるか、表で示す。
|
|
16
|
+
|
|
17
|
+
## ヒートマップの段
|
|
18
|
+
|
|
19
|
+
ヒートマップのセルを、値の大きさごとに5つの段で塗る色と、セルの上に書く値の色。1つの量の大小を示すので、系列の1つ目と同じく白黒にする。アクセントの色を選んでも変わらない。
|
|
20
|
+
|
|
21
|
+
| トークン | 用途 | Tailwindクラス |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| `heatmap-1` | ヒートマップの1段目のセルの面。いちばん薄い段 | `fill-heatmap-1`、`bg-heatmap-1` |
|
|
24
|
+
| `heatmap-2` | ヒートマップの2段目のセルの面 | `fill-heatmap-2`、`bg-heatmap-2` |
|
|
25
|
+
| `heatmap-3` | ヒートマップの3段目のセルの面 | `fill-heatmap-3`、`bg-heatmap-3` |
|
|
26
|
+
| `heatmap-4` | ヒートマップの4段目のセルの面 | `fill-heatmap-4`、`bg-heatmap-4` |
|
|
27
|
+
| `heatmap-5` | ヒートマップの5段目のセルの面。いちばん濃い段 | `fill-heatmap-5`、`bg-heatmap-5` |
|
|
28
|
+
| `heatmap-1-foreground` | heatmap-1 の上に書くセルの値 | `fill-heatmap-1-foreground`、`text-heatmap-1-foreground` |
|
|
29
|
+
| `heatmap-2-foreground` | heatmap-2 の上に書くセルの値 | `fill-heatmap-2-foreground`、`text-heatmap-2-foreground` |
|
|
30
|
+
| `heatmap-3-foreground` | heatmap-3 の上に書くセルの値 | `fill-heatmap-3-foreground`、`text-heatmap-3-foreground` |
|
|
31
|
+
| `heatmap-4-foreground` | heatmap-4 の上に書くセルの値 | `fill-heatmap-4-foreground`、`text-heatmap-4-foreground` |
|
|
32
|
+
| `heatmap-5-foreground` | heatmap-5 の上に書くセルの値 | `fill-heatmap-5-foreground`、`text-heatmap-5-foreground` |
|
|
33
|
+
|
|
34
|
+
段は、値が大きいほど、置いた面(`background`、`card`、`popover`)との差が大きくなるように並べる。ライトモードでは段が進むほど暗く、ダークモードでは段が進むほど明るくする。隣り合う段どうしの比は1.4:1以上、1段目と面の比は1.25:1以上にし、ライトモードとダークモードの両方で見分けられるようにする(`pnpm check:tokens` で測る)。
|
|
35
|
+
|
|
36
|
+
段の比は3:1に届かないので、セルの値は色の濃さだけで示さない。セルに値を書き、値の表とツールチップでも同じ値を読めるようにする([components/heatmap-chart.md](../components/heatmap-chart.md))。セルの値は、段ごとの `-foreground` で書き、セルの面との比を4.5:1以上にする。段によって、値の色が黒と白で入れ替わる。
|
|
37
|
+
|
|
38
|
+
## グラフ、チャート
|
|
39
|
+
|
|
40
|
+
線、棒、面などのグラフの要素は、背景に対して3:1以上にする。隣り合う系列どうしは、色の差の代わりに隙間や境界の線で区切ってよい。
|
|
41
|
+
|
|
42
|
+
例外は、エリアチャートの面と、サンキー図の流れの帯だけとする。面は、系列の色を不透明度0.2で薄く塗り、重なった後ろの系列と目盛りの線を透かして見せるので、3:1に届かない。系列の見分けと背景との比は、3:1以上の上の縁の線と印で受け持つ([chart/color.md](../chart/color.md) の「色」、[components/area-chart.md](../components/area-chart.md))。サンキー図の流れの帯も、同じ不透明度0.2で塗る。重なった帯と、その奥の帯の縁が透けて見えるようにするためである。帯の背景との比は、元の項目の色で帯の縁に引いた線で受け持つ([components/sankey-chart.md](../components/sankey-chart.md))。面だけで値や系列を示すグラフは作らない。
|
|
43
|
+
|
|
44
|
+
目盛りの線が3:1に届かないときは、値を読み取れるように、4.5:1以上の文字のラベルを要素のすぐ近くに置く。
|
|
45
|
+
|
|
46
|
+
系列を色だけで区別しない。直接のラベル、線の種類、マーカーの形のどれかを添える。
|
|
47
|
+
|
|
48
|
+
グラフが伝える要点を、1〜2文の説明でも示す。細かい値まで伝える必要があるときは、表を添える。
|
|
49
|
+
|
|
50
|
+
系列の色は「[グラフの系列](#グラフの系列)」のトークンを使う。描き方、軸、凡例、読み上げの決まりは [chart.md](../chart.md) に書く。
|
|
51
|
+
|
|
52
|
+
## 禁止事項
|
|
53
|
+
|
|
54
|
+
### ヒートマップの段を、ほかの面や文字に使わない
|
|
55
|
+
|
|
56
|
+
決まり:`COLOR-014`、検査:`review`
|
|
57
|
+
|
|
58
|
+
`heatmap-1`〜`heatmap-5` と、その `-foreground` を、ヒートマップのセル(貢献の記録のマスを含む)と、その凡例やツールチップの見本の外で使わない。白黒の段なので、灰色の面や区切りの色として使いたくなるが、段の値はヒートマップの見分けやすさに合わせて決めていて、ほかの面や文字との比は測っていない。値を変えたときに、関係のない画面の見た目まで変わる。面には `muted`、`secondary` などのニュートラルのトークンを使う。
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
// NG:灰色の面がほしいので、ヒートマップの段を使う
|
|
62
|
+
<div className="bg-heatmap-2 p-4">…</div>
|
|
63
|
+
|
|
64
|
+
// OK
|
|
65
|
+
<div className="bg-muted p-4">…</div>
|
|
66
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# 色の組み方
|
|
2
|
+
|
|
3
|
+
色は白黒を基本とし、主要な操作とフォーカスにだけアクセントの1色を使える。状態を示すときだけ状態の色を使う。グラフで系列を描き分けるときだけ、グラフの系列の色を使う。
|
|
4
|
+
|
|
5
|
+
既定のアクセントは白黒(`mono`)で、すべての色が白黒になる。ルート要素に `data-accent="blue"` のような属性を付けると、`primary` と `ring` の2つだけが、選んだ色の段の値に切り替わる。ほかのトークンは、どの色を選んでも白黒のまま変わらない。選べる色と、参照する段は「[アクセント](#アクセント)」に書く。
|
|
6
|
+
|
|
7
|
+
ライトモードとダークモードでは、同じトークン名を維持し、CSS変数の値だけを切り替える。ダークモードは、OSの設定に従って切り替わる。ルート要素に `data-theme="light"` または `data-theme="dark"` を付けると、OSの設定より優先される。アクセントの色も、モードに合わせて段が切り替わる。
|
|
8
|
+
|
|
9
|
+
部品の実装では、下の表のTailwindクラスを使う。
|
|
10
|
+
|
|
11
|
+
## アクセント
|
|
12
|
+
|
|
13
|
+
`primary` と `ring` を、白黒から1色に切り替えるための値。ルート要素の `data-accent` の値で選ぶ。属性がないときと、表にない値のときは、白黒(`mono`)になる。
|
|
14
|
+
|
|
15
|
+
| `data-accent` の値 | 色 | `primary`(ライト) | `primary`(ダーク) | `ring`(ライト) | `ring`(ダーク) |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| `mono` | 白黒(既定) | ニュートラルの値 | ニュートラルの値 | ニュートラルの値 | ニュートラルの値 |
|
|
18
|
+
| `blue` | ブルー | blue-600 | blue-600 | blue-600 | blue-400 |
|
|
19
|
+
| `purple` | パープル | purple-600 | purple-600 | purple-600 | purple-400 |
|
|
20
|
+
| `green` | グリーン | green-600 | green-600 | green-600 | green-400 |
|
|
21
|
+
| `red` | レッド | red-600 | red-600 | red-600 | red-400 |
|
|
22
|
+
| `orange` | オレンジ | orange-600 | orange-600 | orange-600 | orange-400 |
|
|
23
|
+
|
|
24
|
+
`primary` には、`primary-foreground`(白)との比が4.5:1以上になる600の段を、ライトモードとダークモードの両方で使う。`ring` には、隣の面(`background`、`card`、`popover`)との比が3:1以上になる段を使う。ライトモードでは600、ダークモードでは400の段にする。
|
|
25
|
+
|
|
26
|
+
白黒(`mono`)では、ダークモードの `primary` は灰色(`hsl(0 0% 40%)`)になる。白い文字との比を4.5:1以上に保つ600の段が、ダークモードの背景の上では灰色に見えるためである。これは、決まりとして認める。ボタンが灰色に見えることを避けたいときは、アクセントの色(`data-accent`)を選ぶ。
|
|
27
|
+
|
|
28
|
+
各色の段は、50(最も明るい)から950(最も暗い)までの11段で、同じ段なら、どの色でも白との比がほぼ同じになるように明るさをそろえている。色相は、状態の色と取り違えにくいように、近い状態の色からずらしている(ブルーは `interactive`、パープルは `interactive-visited`、グリーンは `success`、レッドは `danger`、オレンジは `warning` から)。
|
|
29
|
+
|
|
30
|
+
| 段 | blue | purple | green | red | orange |
|
|
31
|
+
| --- | --- | --- | --- | --- | --- |
|
|
32
|
+
| `50` | hsl(225 75% 97.4%) | hsl(262 60% 97.5%) | hsl(128 50% 95.5%) | hsl(348 72% 97.5%) | hsl(24 85% 96.5%) |
|
|
33
|
+
| `100` | hsl(225 75% 94.1%) | hsl(262 60% 94.3%) | hsl(128 50% 89.3%) | hsl(348 72% 94.1%) | hsl(24 85% 91.8%) |
|
|
34
|
+
| `200` | hsl(225 75% 87.3%) | hsl(262 60% 87.7%) | hsl(128 50% 76.6%) | hsl(348 72% 87.2%) | hsl(24 85% 82.1%) |
|
|
35
|
+
| `300` | hsl(225 75% 77.8%) | hsl(262 60% 78.6%) | hsl(128 50% 57.5%) | hsl(348 72% 77.4%) | hsl(24 85% 68%) |
|
|
36
|
+
| `400` | hsl(225 75% 68.7%) | hsl(262 60% 69.9%) | hsl(128 50% 44.4%) | hsl(348 72% 67%) | hsl(24 85% 52.6%) |
|
|
37
|
+
| `500` | hsl(225 75% 61.7%) | hsl(262 60% 63.2%) | hsl(128 50% 37.9%) | hsl(348 72% 57.7%) | hsl(24 85% 44%) |
|
|
38
|
+
| `600` | hsl(225 75% 54%) | hsl(262 60% 56%) | hsl(128 50% 31.3%) | hsl(348 72% 46.1%) | hsl(24 85% 36.4%) |
|
|
39
|
+
| `700` | hsl(225 75% 44.9%) | hsl(262 60% 47.9%) | hsl(128 50% 25.3%) | hsl(348 72% 37.5%) | hsl(24 85% 29.5%) |
|
|
40
|
+
| `800` | hsl(225 75% 35.4%) | hsl(262 60% 37.8%) | hsl(128 50% 19.9%) | hsl(348 72% 29.7%) | hsl(24 85% 23.2%) |
|
|
41
|
+
| `900` | hsl(225 75% 26.4%) | hsl(262 60% 28.2%) | hsl(128 50% 14.8%) | hsl(348 72% 22.4%) | hsl(24 85% 17.3%) |
|
|
42
|
+
| `950` | hsl(225 75% 18.3%) | hsl(262 60% 19.5%) | hsl(128 50% 10.1%) | hsl(348 72% 15.7%) | hsl(24 85% 11.9%) |
|
|
43
|
+
|
|
44
|
+
ルートの中の要素に `data-accent` を付けると、その要素の中だけ、`primary` と `ring` が選んだ色の値になる。ルートでほかの色を選んでいても変わらない。中の要素の `data-accent="mono"` は、その要素の中だけを白黒の値に戻す。色ごとの見本を並べるカラーピッカー([components/color-picker.md](../components/color-picker.md))のためのもので、画面の一部だけ別のアクセントにするためには使わない。1つの画面の主要な操作の色が、場所によって変わってしまう。
|
|
45
|
+
|
|
46
|
+
段は、`tokens.css` にCSS変数やクラスとしては出さない。部品では、段を直接使わず、`bg-primary` や `ring-ring` のトークンのクラスを使う。
|
|
47
|
+
|
|
48
|
+
## 禁止事項
|
|
49
|
+
|
|
50
|
+
### 生のカラーパレットを使わない
|
|
51
|
+
|
|
52
|
+
決まり:`COLOR-001`、検査:`lint:colors`
|
|
53
|
+
|
|
54
|
+
`blue-500` や `gray-200` のような、Tailwindの生カラーパレットを直接使わない。アクセントの段(`blue-600` など)も、部品や画面では直接使わない。アクセントの色にしたいときは、`data-accent` で切り替わる `primary` と `ring` を使う。実装では、`pnpm lint:colors` で検出する(準備中)。
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
// NG
|
|
58
|
+
<p className="text-gray-500">12件のドキュメント</p>
|
|
59
|
+
|
|
60
|
+
// OK
|
|
61
|
+
<p className="text-muted-foreground">12件のドキュメント</p>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### クラス名を組み立てない
|
|
65
|
+
|
|
66
|
+
決まり:`COLOR-002`、検査:`lint:colors`
|
|
67
|
+
|
|
68
|
+
クラス名を、テンプレートリテラルや文字列の連結で組み立てない。Tailwindが検出できず、エラーや警告のないまま色が付かなくなる。
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
// NG
|
|
72
|
+
<div className={`bg-${variant}-solid`} />
|
|
73
|
+
|
|
74
|
+
// OK
|
|
75
|
+
const SOLID = { danger: "bg-danger-solid", success: "bg-success-solid" } as const;
|
|
76
|
+
<div className={SOLID[variant]} />
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### `dark:` のクラスを書かない
|
|
80
|
+
|
|
81
|
+
決まり:`COLOR-008`、検査:`lint:colors`
|
|
82
|
+
|
|
83
|
+
部品に `dark:bg-gray-800` のような `dark:` のクラスを書かない。トークンは、モードに合わせて自動で切り替わる。部品にはトークンのクラスだけを書く。`dark:` を書くと、色を2か所で管理することになり、ずれる。
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
// NG
|
|
87
|
+
<div className="bg-white text-gray-900 dark:bg-gray-800 dark:text-gray-100">…</div>
|
|
88
|
+
|
|
89
|
+
// OK
|
|
90
|
+
<div className="bg-card text-card-foreground">…</div>
|
|
91
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# ニュートラル
|
|
2
|
+
|
|
3
|
+
背景、面、文字、線に使う色。
|
|
4
|
+
|
|
5
|
+
## 面
|
|
6
|
+
|
|
7
|
+
| トークン | 用途 | Tailwindクラス |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `background` | ページ全体の背景 | `bg-background` |
|
|
10
|
+
| `card` | カード、パネルの面 | `bg-card` |
|
|
11
|
+
| `popover` | ポップオーバー、ドロップダウン、ダイアログの面 | `bg-popover` |
|
|
12
|
+
| `muted` | 控えめな面 | `bg-muted` |
|
|
13
|
+
| `primary` | 主要な操作 | `bg-primary` |
|
|
14
|
+
| `secondary` | 副次的な操作、控えめな強調 | `bg-secondary` |
|
|
15
|
+
| `accent` | 選択中の項目の背景 | `bg-accent` |
|
|
16
|
+
|
|
17
|
+
## 文字
|
|
18
|
+
|
|
19
|
+
| トークン | 用途 | Tailwindクラス |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| `foreground` | `background` の上の文字。本文、主要な文字 | `text-foreground` |
|
|
22
|
+
| `card-foreground` | `card` の上の文字 | `text-card-foreground` |
|
|
23
|
+
| `popover-foreground` | `popover` の上の文字 | `text-popover-foreground` |
|
|
24
|
+
| `muted-foreground` | `muted` の上の文字。補助的な文字、ラベル | `text-muted-foreground` |
|
|
25
|
+
| `primary-foreground` | `primary` の上の文字 | `text-primary-foreground` |
|
|
26
|
+
| `secondary-foreground` | `secondary` の上の文字 | `text-secondary-foreground` |
|
|
27
|
+
| `accent-foreground` | `accent` の上の文字 | `text-accent-foreground` |
|
|
28
|
+
| `icon` | `background`、`card`、`popover`、`muted` の上のアイコン | `text-icon` |
|
|
29
|
+
| `primary-icon` | `primary` と `bg-*-solid` の上のアイコン | `text-primary-icon` |
|
|
30
|
+
| `secondary-icon` | `secondary` の上のアイコン | `text-secondary-icon` |
|
|
31
|
+
| `accent-icon` | `accent` の上のアイコン | `text-accent-icon` |
|
|
32
|
+
|
|
33
|
+
`primary-foreground` と `primary-icon` は、ライトモードとダークモードの両方で白にする。`secondary-foreground` と `secondary-icon` は、ライトモードでは白黒(`mono`)の `primary` の面と同じ色、ダークモードでは `foreground` と同じ色にする。アクセントの色を選んでも、白黒のまま変わらない。
|
|
34
|
+
|
|
35
|
+
> [!IMPORTANT]
|
|
36
|
+
> 背景と文字は組で使う。`bg-card` の上には `text-card-foreground`、`bg-danger-surface` の上には `text-danger-surface-foreground` のように、面と同じ名前の `-foreground` を選ぶ。`bg-*-solid` の上のアイコンには `text-primary-icon` を使う。`bg-*-solid` の上には文字を置かない。`text-white` などの生の色で済ませない。
|
|
37
|
+
|
|
38
|
+
## 線
|
|
39
|
+
|
|
40
|
+
| トークン | 用途 | Tailwindクラス |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| `border` | 枠線や区切り線 | `border-border` |
|
|
43
|
+
| `input` | フォームの入力欄の枠線 | `border-input` |
|
|
44
|
+
| `ring` | フォーカスリング | `ring-ring` |
|
|
45
|
+
|
|
46
|
+
`border` のクラスだけを書いた枠線も、`border` のトークンの色になる。`tokens.css` が、枠線の既定の色を `border` にしている。
|
|
47
|
+
|
|
48
|
+
## 暗幕
|
|
49
|
+
|
|
50
|
+
| トークン | 用途 | Tailwindクラス |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| `overlay` | モーダル、ドロワーの後ろの暗幕 | `bg-overlay/50` |
|
|
53
|
+
|
|
54
|
+
`overlay` は、`bg-overlay/50` のように不透明度を付けて使う。
|
|
55
|
+
|
|
56
|
+
## 禁止事項
|
|
57
|
+
|
|
58
|
+
### グラデーションを使わない
|
|
59
|
+
|
|
60
|
+
決まり:`COLOR-009`、検査:`lint:colors`
|
|
61
|
+
|
|
62
|
+
背景と文字のどちらにも、グラデーションを使わない。単色のトークンで塗る。
|
|
63
|
+
|
|
64
|
+
例外は、値のない `Progress` の棒だけである。済んだ量の色を端の消えたぼかしで描き、明滅させて、量がまだ分からないことを示す([components/progress.md](../components/progress.md))。例外のコードには、`lint-ignore COLOR-009` に理由を書く。
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
// NG
|
|
68
|
+
<section className="bg-gradient-to-r from-purple-500 to-blue-500">…</section>
|
|
69
|
+
<h1 className="bg-gradient-to-r from-purple-500 to-blue-500 bg-clip-text text-transparent">最近のドキュメント</h1>
|
|
70
|
+
|
|
71
|
+
// OK
|
|
72
|
+
<section className="bg-muted">…</section>
|
|
73
|
+
<h1 className="text-foreground">最近のドキュメント</h1>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### カードの端に色の帯を付けない
|
|
77
|
+
|
|
78
|
+
決まり:`COLOR-012`、検査:`review`
|
|
79
|
+
|
|
80
|
+
カードの左端に `border-l-4` などで色の帯を付けない。意味のない装飾になり、何の状態か分からない。状態を示すなら、`-surface` の面と、記号や文言で示す。
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
// NG
|
|
84
|
+
<div className="border-l-4 border-blue-500 bg-card">…</div>
|
|
85
|
+
|
|
86
|
+
// OK:状態を示すとき
|
|
87
|
+
<div className="bg-info-surface text-info-surface-foreground">…</div>
|
|
88
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# 操作と状態
|
|
2
|
+
|
|
3
|
+
操作できることや、成功やエラーなどの状態を示す色。意味ごとに6つのくくりに分け、くくりごとに同じ6つのトークンを持つ。
|
|
4
|
+
|
|
5
|
+
| くくり | 意味 |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `interactive` | リンク、クリックできるもの |
|
|
8
|
+
| `danger` | 破壊的な操作、エラー |
|
|
9
|
+
| `success` | 成功、完了、確定 |
|
|
10
|
+
| `warning` | 注意、確認が必要なこと |
|
|
11
|
+
| `info` | 情報、区分のラベル |
|
|
12
|
+
| `inactive` | 非アクティブ、期限切れ、目的にまだ届いていない状態(下書き) |
|
|
13
|
+
|
|
14
|
+
くくりの名前そのものはトークンではない。部品では、くくりの名前に次の接尾辞を付けたトークンを使う。
|
|
15
|
+
|
|
16
|
+
| 接尾辞 | 用途 | Tailwindクラスの例 |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| `-text` | `background`、`card`、`popover`、`muted`、`secondary` の上に置く文字 | `text-danger-text` |
|
|
19
|
+
| `-surface` | 薄く塗った面 | `bg-danger-surface` |
|
|
20
|
+
| `-surface-foreground` | `-surface` の上の文字 | `text-danger-surface-foreground` |
|
|
21
|
+
| `-surface-icon` | `-surface` の上のアイコン | `text-danger-surface-icon` |
|
|
22
|
+
| `-solid` | 濃く塗った面。アイコンの背景、ステータスドットに使う | `bg-danger-solid` |
|
|
23
|
+
| `-icon` | `background`、`card`、`popover`、`muted`、`secondary` の上に置くアイコン | `text-danger-icon` |
|
|
24
|
+
|
|
25
|
+
1つのくくりだけが持つトークンは、次の表に書く。
|
|
26
|
+
|
|
27
|
+
| トークン | 用途 | Tailwindクラス |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `interactive-visited` | 訪問済みのリンクの文字 | `visited:text-interactive-visited` |
|
|
30
|
+
|
|
31
|
+
## 禁止事項
|
|
32
|
+
|
|
33
|
+
### 本文の中のリンクを色だけで区別しない
|
|
34
|
+
|
|
35
|
+
決まり:`COLOR-003`、検査:`review`
|
|
36
|
+
|
|
37
|
+
本文の中のリンクには、常に下線を付け、訪問済み(`visited:`)の色も付ける。ナビゲーション、ボタンの形のリンク、カード全体のリンク、アプリの画面の一覧のリンクには、訪問済みの色を付けない。形と位置で押せると分かるなら、下線も付けない。
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
// NG
|
|
41
|
+
<a className="text-interactive-text">共有の設定について</a>
|
|
42
|
+
|
|
43
|
+
// OK:本文の中のリンクは TextLink で置く。下線と訪問済みの色を部品が付ける
|
|
44
|
+
<TextLink href="/help/share">共有の設定について</TextLink>
|
|
45
|
+
|
|
46
|
+
// OK:ナビゲーションに下線、訪問済みの色を付けない
|
|
47
|
+
<nav><NavLink href="/settings">設定</NavLink></nav>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 状態色をコンポーネントに直書きしない
|
|
51
|
+
|
|
52
|
+
決まり:`COLOR-004`、検査:`review`
|
|
53
|
+
|
|
54
|
+
ステータス、ロール、増減のような意味のある状態色を、コンポーネントの中に直書きしない。`constants/`(またはプロジェクトで同じ役割の場所)の色マップを、唯一の参照元にする。Plain UIの部品では、色マップの値を `variant` の名前(状態の色のくくり)にする。`className` は外側の配置だけに使うので、色を渡さない。
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
// NG:クラス文字列で直書きする
|
|
58
|
+
<Badge className={status === "failed" ? "bg-danger-surface text-danger-surface-foreground" : "bg-success-surface text-success-surface-foreground"} />
|
|
59
|
+
|
|
60
|
+
// NG:画面ごとに variant を決める
|
|
61
|
+
<Badge variant={status === "failed" ? "danger" : "success"} />
|
|
62
|
+
|
|
63
|
+
// OK:constants/status.ts
|
|
64
|
+
export const STATUS_VARIANT = {
|
|
65
|
+
failed: "danger",
|
|
66
|
+
uploaded: "success",
|
|
67
|
+
} as const satisfies Record<Status, StatusVariant>;
|
|
68
|
+
|
|
69
|
+
// OK:コンポーネント
|
|
70
|
+
<Badge variant={STATUS_VARIANT[status]} />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 同じ色を別の意味に流用しない
|
|
74
|
+
|
|
75
|
+
決まり:`COLOR-006`、検査:`review`
|
|
76
|
+
|
|
77
|
+
リンクと情報のラベル、お気に入りとエラーのように、意味の違うものに同じくくりの色を使わない。意味に合うくくりがなければ、ニュートラルの色で描くか、くくりを足す。
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
// NG:ファイルの種類のラベルにリンクの色を使う
|
|
81
|
+
<span className="text-interactive-text">PDF</span>
|
|
82
|
+
// NG:お気に入りにエラーの色を使う
|
|
83
|
+
<StarIcon className="text-danger-icon" />
|
|
84
|
+
|
|
85
|
+
// OK
|
|
86
|
+
<span className="text-info-text">PDF</span>
|
|
87
|
+
<StarIcon className="text-icon" />
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### `-solid` をボタンの背景に使わない
|
|
91
|
+
|
|
92
|
+
決まり:`COLOR-007`、検査:`review`
|
|
93
|
+
|
|
94
|
+
`-solid` は、アイコンの背景やステータスドットに使い、ボタンには使わない。主要なボタンには `primary` を使う。削除のような破壊的な操作のボタンは、画面に置くときも確認ダイアログの中でも、`secondary` の面に `-text` の文字で描く。
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
// NG
|
|
98
|
+
<button className="bg-success-solid text-primary-foreground">保存する</button>
|
|
99
|
+
<button className="bg-danger-surface text-danger-surface-foreground">ゴミ箱に移動する</button>
|
|
100
|
+
<button className="bg-danger-solid text-primary-foreground">完全に削除する</button>
|
|
101
|
+
|
|
102
|
+
// OK
|
|
103
|
+
<button className="bg-primary text-primary-foreground">保存する</button>
|
|
104
|
+
<span className="inline-flex items-center gap-2">
|
|
105
|
+
<span className="size-2 rounded-full bg-success-solid" />
|
|
106
|
+
アップロード済み
|
|
107
|
+
</span>
|
|
108
|
+
|
|
109
|
+
// OK:ゴミ箱に移動するボタン(画面に置くときも、確認ダイアログの中でも)
|
|
110
|
+
<button className="bg-secondary text-danger-text">ゴミ箱に移動する</button>
|
|
111
|
+
```
|
package/docs/color.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# カラー
|
|
2
|
+
|
|
3
|
+
このドキュメントでは、色のトークンと、その使い方を決める。新しい色を作らず、まず表からトークンを選ぶ。
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
話題ごとに、本文の節と、それに関わる禁止事項を `docs/color/` の1つのファイルにまとめて書く。このファイルは索引とし、下の見出しから各ファイルへ移る。決まりの名前(`COLOR-001` など)は、移した後も変えていない。名前で探すときは、`docs/color/` の中を探す。
|
|
7
|
+
|
|
8
|
+
## 色の組み方
|
|
9
|
+
|
|
10
|
+
[color/foundation.md](./color/foundation.md) に書く。アクセントの切り替えも、このファイルに書く。
|
|
11
|
+
|
|
12
|
+
## トークン
|
|
13
|
+
|
|
14
|
+
ニュートラル(面、文字、線、暗幕)は、[color/neutral.md](./color/neutral.md) に書く。
|
|
15
|
+
|
|
16
|
+
操作と状態は、[color/state.md](./color/state.md) に書く。
|
|
17
|
+
|
|
18
|
+
グラフの系列とヒートマップの段は、[color/data-viz.md](./color/data-viz.md) に書く。
|
|
19
|
+
|
|
20
|
+
## コントラスト
|
|
21
|
+
|
|
22
|
+
[color/contrast.md](./color/contrast.md) に書く。グラフ、チャートのコントラストは、[color/data-viz.md](./color/data-viz.md) に書く。
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# アコーディオン
|
|
2
|
+
|
|
3
|
+
アコーディオンは、`Accordion` の中に `AccordionItem` を並べて置く。ネイティブの `<details>` と `<summary>` で描き、開閉、キーボードの操作(Enter、Space)、開閉の状態の読み上げは、ブラウザーに任せる。開閉の行は、高さ44px以上を押せる範囲にし、右端の下向きの矢印(`ChevronDownIcon`)を、開いているときに上向きにする。名前が折り返しても、矢印は名前の1行目に揃える。`Radio` と同じく、矢印を1行目の高さの枠(`h-lh`)に入れ、名前と矢印の組を `items-start` で並べて、その組を44pxの行の中央に置く([layout/alignment.md](../layout/alignment.md) の「並びの揃え」)。1行のときは、名前も矢印も44pxの行の中央に来る。折り返したときは、行が上下の余白(`py-2`)の分だけ高くなる。矢印を回す動きは150msで、動きを減らす設定では止める。中身を開く動きは付けない。高さを動かすことになり、[interaction/motion.md](../interaction/motion.md) の「動き」で、動かすのは不透明度と位置だけと決めているためである。
|
|
4
|
+
|
|
5
|
+
同時に1つだけ開くときは、`exclusive` を付ける。`<details>` の `name` 属性で作り、1つを開くとブラウザーがほかを閉じる。`name` はページの中で共有されるので、`Accordion` がグループごとに重ならない値を作る。`name` 属性はBaseline 2024で、Chrome・Edge 120、Firefox 130、Safari 17.2から使える([MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDetailsElement/name)、[Chrome for Developers](https://developer.chrome.com/docs/css-ui/exclusive-accordion))。対応しないブラウザーでは、同時にいくつでも開ける形になるだけで、開閉はできる。
|
|
6
|
+
|
|
7
|
+
開閉の行(`summary`)には、見出しの要素を入れない。`summary` はボタンとして読み上げられ、中の見出しは、読み上げの見出しの一覧に出ないことがある([Scott O'Hara「details summary」](https://www.scottohara.me/blog/2022/09/12/details-summary.html))。見出しは、アコーディオンの前に置く。項目ごとに見出しの一覧から移りたい内容なら、畳まずに見出しと本文で並べる。
|
|
8
|
+
|
|
9
|
+
| 部品 | props | 値 | 決まり |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| `Accordion` | `exclusive` | `true`、`false` | 省いたときは `false` で、いくつでも同時に開ける。`true` にすると、同時に1つだけ開く |
|
|
12
|
+
| `AccordionItem` | `label` | 文字列 | 開閉の行に出す名前。文字列だけを受け取り、見出しの要素は入れない |
|
|
13
|
+
| `AccordionItem` | `defaultOpen` | `true`、`false` | 最初に開いておく。開いた後の開閉は、ブラウザーが持つ |
|
|
14
|
+
| `AccordionItem` | `onToggle` など | `details` の標準の属性 | そのまま受け取る。`name`、`open`、`title` は受け取らない |
|
|
15
|
+
| どちらも | `className` | 余白と幅のクラス | 外側の配置だけに使う |
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<section>
|
|
19
|
+
<h2 className="mb-4 text-xl font-semibold">よくある質問</h2>
|
|
20
|
+
<Accordion exclusive>
|
|
21
|
+
<AccordionItem label="ゴミ箱に移動したドキュメントは、いつ消えますか" defaultOpen>
|
|
22
|
+
<p>ゴミ箱に移動してから30日後に、完全に削除されます。</p>
|
|
23
|
+
</AccordionItem>
|
|
24
|
+
<AccordionItem label="共有したリンクを止めるには">
|
|
25
|
+
<p>共有の設定で「リンクを知っている全員」をオフにします。</p>
|
|
26
|
+
</AccordionItem>
|
|
27
|
+
</Accordion>
|
|
28
|
+
</section>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 禁止事項
|
|
32
|
+
|
|
33
|
+
### アコーディオンの開閉の行に見出しを入れない
|
|
34
|
+
|
|
35
|
+
決まり:`COMPONENTS-026`、検査:`review`
|
|
36
|
+
|
|
37
|
+
アコーディオンの開閉の行(`summary`)の中に、`h2` や `h3` のような見出しを置かない。`summary` はボタンとして読み上げられ、中の見出しは、読み上げの見出しの一覧に出ないことがある。見出しはアコーディオンの前に置き、開閉の行は文字だけにする。
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
// NG
|
|
41
|
+
<details>
|
|
42
|
+
<summary><h3>共有したリンクを止めるには</h3></summary>
|
|
43
|
+
…
|
|
44
|
+
</details>
|
|
45
|
+
|
|
46
|
+
// OK
|
|
47
|
+
<h2>よくある質問</h2>
|
|
48
|
+
<Accordion>
|
|
49
|
+
<AccordionItem label="共有したリンクを止めるには">…</AccordionItem>
|
|
50
|
+
</Accordion>
|
|
51
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# エージェントを作るフォーム
|
|
2
|
+
|
|
3
|
+
エージェントを作るフォームは、AIのエージェントの名前、指示、使わせる道具を決めて作るブロックである。`AgentForm` で置く。[フォームのまとまり](./form-section.md)の `FormSection` で、「基本の情報」と「道具」の2つのまとまりに区切り、今の入力の部品(`Field`、`Input`、`Textarea`、`Checkbox`)で組む。
|
|
4
|
+
|
|
5
|
+
値、必須の確かめ、エラーのまとめ、最初のエラーへのフォーカス、送信中は、この部品が持つ([質問フォーム](./question-form.md)と同じ)。作った後の結果(トースト、画面の移動)と、作る処理そのものは、使う側の `onSubmit` が持つ。
|
|
6
|
+
|
|
7
|
+
| 項目 | 部品 | 決まり |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| 名前 | `Input` | 必須。エージェントの一覧と、チャットの相手の名前に出る |
|
|
10
|
+
| 指示 | `Textarea` | 必須。役割、答え方、してはいけないことを書く |
|
|
11
|
+
| 使わせる道具 | `Checkbox` の並び | 0個以上を選ぶ。`fieldset` と `legend` で名前を付ける |
|
|
12
|
+
|
|
13
|
+
使わせる道具は、送信のボタンを押すまで反映しない選択なので、スイッチではなくチェックボックスにする([コンポーネント](../components.md)の「操作と入力」、COMPONENTS-126)。道具が0件なら、「道具」のまとまりを出さない。
|
|
14
|
+
|
|
15
|
+
入力を確かめる時機とエラーの出し方は、[form.md](../form.md) の索引から辿る決まりに従う。必須の項目は、入力欄から離れたときに確かめ、エラーの出た項目は、直したらすぐに消す。送信したときは、画面の並びで最初のエラーの項目へフォーカスを移し、エラーが2つ以上ならフォームの先頭にまとめを出す。サーバーで見つかった、項目に結び付けられるエラー(同じ名前がある、など)は、`onSubmit` から項目ごとのエラーを返す。通信やサーバーの失敗は例外で知らせ、フォームの先頭に「エージェントを作れませんでした。時間をおいてもう一度送信してください。」のバナーを出す。
|
|
16
|
+
|
|
17
|
+
| props | 値 | 決まり |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `tools` | `{ value, label }` の配列 | 選べる道具 |
|
|
20
|
+
| `defaultValues` | `{ name?, instructions?, tools? }` | 最初の値。作ったエージェントを直すときに渡す |
|
|
21
|
+
| `onSubmit` | 関数 | 必須の確かめを通ったときに、値(`{ name, instructions, tools }`)で呼ぶ。`Promise` が終わるまで送信中にする。項目ごとのエラー(`{ name?, instructions?, tools? }`)を返すと、送信したときのエラーと同じに出す |
|
|
22
|
+
| `submitLabel` | 文字列 | 送信のボタンの文言。省いたときは「エージェントを作る」。直すときは「変更を保存する」にする |
|
|
23
|
+
| `pendingLabel` | 文字列 | 送信中の文言。省いたときは「作成中」 |
|
|
24
|
+
| `level` | `2`、`3` | まとまりの見出しの階層。ページの `h1` の下なら `2`、ダイアログの中や `h2` の節の中なら `3`。省いたときは `2`(COMPONENTS-047) |
|
|
25
|
+
| `className` | 余白と幅のクラス | 外側の配置だけに使う |
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<h1>エージェントを作る</h1>
|
|
29
|
+
<AgentForm
|
|
30
|
+
tools={[
|
|
31
|
+
{ value: "web-search", label: "ウェブ検索" },
|
|
32
|
+
{ value: "files", label: "共有フォルダのファイルを読む" },
|
|
33
|
+
]}
|
|
34
|
+
onSubmit={async values => {
|
|
35
|
+
const result = await createAgent(values);
|
|
36
|
+
if (result.errors) return result.errors;
|
|
37
|
+
navigate(`/agents/${result.id}`);
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 禁止事項
|
|
43
|
+
|
|
44
|
+
### 使わせる道具を、スイッチで選ばせない
|
|
45
|
+
|
|
46
|
+
決まり:`COMPONENTS-126`、検査:`review`
|
|
47
|
+
|
|
48
|
+
エージェントを作るフォームの中で、使わせる道具をスイッチで選ばせない。スイッチは押した時点で反映する切り替えであり、送信のボタンを押すまで反映しないフォームの中に置くと、押しただけで道具が使えるようになったと受け取られる。チェックボックスにする。
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
// NG
|
|
52
|
+
<Switch checked={webSearch} onChange={setWebSearch}>ウェブ検索</Switch>
|
|
53
|
+
|
|
54
|
+
// OK
|
|
55
|
+
<AgentForm tools={[{ value: "web-search", label: "ウェブ検索" }]} onSubmit={create} />
|
|
56
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# エージェントの進み
|
|
2
|
+
|
|
3
|
+
エージェントの進みは、AIのエージェントが進める作業の手順を、進める順に並べ、手順ごとに、済み、実行中、待ち、失敗を示す一覧である。`AgentSteps` の中に、`AgentStep` を1件ずつ置く。
|
|
4
|
+
|
|
5
|
+
利用者がチェックして済みにする一覧ではない。手順の状態はエージェントが進めるもので、利用者は押して変えない。利用者がチェックして完了を付けるやることの一覧には、[タスクリスト](./task-list.md)の `TaskList` を使う(COMPONENTS-118)。
|
|
6
|
+
|
|
7
|
+
| 示すもの | 部品 |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| 利用者が完了を付ける、やることの一覧 | `TaskList` |
|
|
10
|
+
| エージェントが進める作業の手順と、その状態 | `AgentSteps` |
|
|
11
|
+
|
|
12
|
+
手順の状態は、印と文字の両方で示す。色や印だけでは、色の見分けにくい人や、読み上げで使う人に伝わらないためである(COMPONENTS-117)。印は、名前の1行目の高さの枠(`h-lh`)に入れて、1行目に揃える([layout/alignment.md](../layout/alignment.md) の「並びの揃え」)。
|
|
13
|
+
|
|
14
|
+
| `status` | 印 | 文字 |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| `done` | 丸の中のチェック(`CircleCheckIcon`、`success-icon`) | 「済み」 |
|
|
17
|
+
| `running` | 回るスピナー(`Spinner`)。動きを減らす設定では止まる | 「実行中」。項目に `aria-current="step"` を付け、今の手順として読み上げる |
|
|
18
|
+
| `pending` | 点線の丸(`CircleDashedIcon`、`icon`) | 「待ち」 |
|
|
19
|
+
| `failed` | 丸の中の感嘆符(`CircleAlertIcon`、`danger-icon`)。`Banner` の danger と同じ形 | 「失敗」。文字も `danger-text` の色にする |
|
|
20
|
+
|
|
21
|
+
`detail` には、手順の結果(「5件のページを見つけた」)や、失敗の理由を書く。状態の文字に続けて、「失敗:ページを開けなかった。」のように出す。
|
|
22
|
+
|
|
23
|
+
手順が変わるたびに読み上げる領域は持たない。返答を待っていることは、メッセージの並びの末尾の `ReplyLoader` で伝える([返答ローダー](./reply-loader.md))。手順の状態は、利用者が一覧を読みに来たときに読める。
|
|
24
|
+
|
|
25
|
+
| props | 値 | 決まり |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| `AgentSteps` の `aria-label`、`aria-labelledby` | 文字列 | 一覧の名前(「作業の手順」)。見出しがあれば `aria-labelledby` で指す |
|
|
28
|
+
| `AgentSteps` の `className` | 余白と幅のクラス | 外側の配置だけに使う |
|
|
29
|
+
| `title` | 文字列 | 手順の名前。「関係するページを検索する」のように、何をするかを書く |
|
|
30
|
+
| `status` | `done`、`running`、`pending`、`failed` | 手順の状態 |
|
|
31
|
+
| `detail` | 文字列 | 手順の結果や、失敗の理由。省いたときは、状態の文字だけを出す |
|
|
32
|
+
| `AgentStep` の `className` | 余白と幅のクラス | 外側の配置だけに使う |
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
<AgentSteps aria-label="作業の手順">
|
|
36
|
+
<AgentStep title="質問の意図を整理する" status="done" />
|
|
37
|
+
<AgentStep title="関係するページを検索する" status="done" detail="5件のページを見つけた" />
|
|
38
|
+
<AgentStep title="見つけたページを読む" status="running" />
|
|
39
|
+
<AgentStep title="返答をまとめる" status="pending" />
|
|
40
|
+
</AgentSteps>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## エージェントの進みの作り方
|
|
44
|
+
|
|
45
|
+
順に意味があるので、一覧はネイティブの `ol` と `li` にする。押せる要素を持たないので、項目の間は `space-y-2` だけで離し、区切り線は引かない。
|
|
46
|
+
|
|
47
|
+
## 禁止事項
|
|
48
|
+
|
|
49
|
+
### 手順の状態を、印や色だけで示さない
|
|
50
|
+
|
|
51
|
+
決まり:`COMPONENTS-117`、検査:`review`
|
|
52
|
+
|
|
53
|
+
済みの手順を緑の印だけで、失敗した手順を赤い色だけで示さない。色の見分けにくい人や、読み上げで使う人に伝わらない。「済み」「失敗」のように、状態を文字で書く。
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
// NG
|
|
57
|
+
<li><CircleCheckIcon className="size-4 text-success-icon" />検索する</li>
|
|
58
|
+
|
|
59
|
+
// OK:状態の文字を2行目に書く
|
|
60
|
+
<AgentStep title="検索する" status="done" />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 利用者が完了を付ける一覧に、`AgentSteps` を使わない
|
|
64
|
+
|
|
65
|
+
決まり:`COMPONENTS-118`、検査:`review`
|
|
66
|
+
|
|
67
|
+
利用者がチェックして完了を付けるやることの一覧を、`AgentSteps` で作らない。また、エージェントが進める手順を、`TaskList` のチェックボックスで示さない。押して変えられるかどうかが、見た目と読み上げで食い違う。
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
// NG:エージェントの手順を、押せるチェックボックスで示す
|
|
71
|
+
<TaskItem title="関係するページを検索する" completed onCompletedChange={() => {}} />
|
|
72
|
+
|
|
73
|
+
// OK
|
|
74
|
+
<AgentStep title="関係するページを検索する" status="done" />
|
|
75
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# エージェントの考え
|
|
2
|
+
|
|
3
|
+
エージェントの考えは、AIが返答の前に考えた過程を、たたんだ形で返答の上に置くブロックである。`AgentThinking` で置く。
|
|
4
|
+
|
|
5
|
+
既定はたたんでおき、「考えた過程を見る」を押すと開く。考えた過程は、返答を確かめたい人だけが読むもので、返答の本文より先に読ませないためである(COMPONENTS-119)。閉じた行には、考えている間は「考えています(12秒)」と、何秒考えているかを書き、考え終わったら「12秒考えました」と書く。60秒からは「1分5秒」のように書く。
|
|
6
|
+
|
|
7
|
+
秒数は、使う側が持つ。考えている間は、1秒ごとに増やして `seconds` に渡す。サーバーが考えた時間を返すなら、その値を渡す。
|
|
8
|
+
|
|
9
|
+
考えている間は、閉じた行にスピナーを出す。スピナーの回転は、動きを減らす設定では止まり、「考えています」の文字で考えていることが分かる。考え終わったら(返答の文が出始めたら)、`thinking` を `false` にする。
|
|
10
|
+
|
|
11
|
+
読み上げの領域は持たない。1秒ごとに変わる秒数を読み上げると、読み上げが割り込み続けるためである(COMPONENTS-120)。返答を待っていることは、メッセージの並びの末尾の `ReplyLoader` で1回だけ伝え([返答ローダー](./reply-loader.md))、`AgentThinking` が出たら、その表示が進行中を示すので、`ReplyLoader` の `pending` を `false` にする。返答の文が出始めたときと同じ扱いである。
|
|
12
|
+
|
|
13
|
+
| props | 値 | 決まり |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `thinking` | `true`、`false` | 考えている間は `true` にする |
|
|
16
|
+
| `seconds` | 数値 | 考えた秒数。負の値と小数は、0以上の整数にそろえて書く |
|
|
17
|
+
| `children` | 文字列か要素 | 考えた過程の文。改行はそのまま出す |
|
|
18
|
+
| `className` | 余白と幅のクラス | 外側の配置だけに使う |
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
const [seconds, setSeconds] = useState(0);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!thinking) return;
|
|
24
|
+
const timer = setInterval(() => setSeconds(s => s + 1), 1000);
|
|
25
|
+
return () => clearInterval(timer);
|
|
26
|
+
}, [thinking]);
|
|
27
|
+
|
|
28
|
+
<article className="space-y-2">
|
|
29
|
+
<AgentThinking thinking={thinking} seconds={seconds}>
|
|
30
|
+
{thought}
|
|
31
|
+
</AgentThinking>
|
|
32
|
+
<p>{reply}</p>
|
|
33
|
+
</article>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## エージェントの考えの作り方
|
|
37
|
+
|
|
38
|
+
ネイティブの `<details>` と `<summary>` で作り、開閉、キーボード(Enter・Space)、開閉の状態の読み上げは、ブラウザーに任せる([アコーディオン](./accordion.md)と同じ)。押せる範囲は、閉じた行の全体で高さ44px以上にする。考えた過程は、返答の本文と分けるため、左の線(`border-l`)で区切り、補足の文字の色(`muted-foreground`)で書く。
|
|
39
|
+
|
|
40
|
+
## 禁止事項
|
|
41
|
+
|
|
42
|
+
### 考えた過程を、開いたまま返答の前に置かない
|
|
43
|
+
|
|
44
|
+
決まり:`COMPONENTS-119`、検査:`review`
|
|
45
|
+
|
|
46
|
+
考えた過程を、開いた状態で返答の上に置かない。利用者は、求めた返答より先に長い過程を読まされ、読み上げでも返答にたどり着くまでに時間がかかる。既定はたたんでおき、読みたい人が開く。
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
// NG
|
|
50
|
+
<p className="text-muted-foreground">{thought}</p>
|
|
51
|
+
<p>{reply}</p>
|
|
52
|
+
|
|
53
|
+
// OK
|
|
54
|
+
<AgentThinking thinking={false} seconds={12}>{thought}</AgentThinking>
|
|
55
|
+
<p>{reply}</p>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 考えている秒数を、読み上げの領域に入れない
|
|
59
|
+
|
|
60
|
+
決まり:`COMPONENTS-120`、検査:`review`
|
|
61
|
+
|
|
62
|
+
「考えています(12秒)」のような、1秒ごとに変わる文字を、`aria-live` の領域に入れない。秒数が変わるたびに読み上げが割り込み、ほかの操作ができなくなる。待っていることは、`ReplyLoader` で1回だけ伝える。
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
// NG
|
|
66
|
+
<p aria-live="polite">考えています({seconds}秒)</p>
|
|
67
|
+
|
|
68
|
+
// OK
|
|
69
|
+
<AgentThinking thinking seconds={seconds}>{thought}</AgentThinking>
|
|
70
|
+
```
|