@orangesk/orange-design-system 2.0.0-beta.46 → 2.0.0-beta.48
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/build/components/BlockAction/style.css +1 -1
- package/build/components/BlockAction/style.css.map +1 -1
- package/build/components/Breadcrumbs/style.css +1 -1
- package/build/components/Breadcrumbs/style.css.map +1 -1
- package/build/components/Carousel/style.css +1 -1
- package/build/components/Carousel/style.css.map +1 -1
- package/build/components/DocumentationSidebar/style.css +1 -1
- package/build/components/DocumentationSidebar/style.css.map +1 -1
- package/build/components/Footer/style.css +1 -1
- package/build/components/Footer/style.css.map +1 -1
- package/build/components/Icon/style.css +1 -1
- package/build/components/Icon/style.css.map +1 -1
- package/build/components/Link/style.css +1 -1
- package/build/components/Link/style.css.map +1 -1
- package/build/components/Loader/style.css +1 -1
- package/build/components/Loader/style.css.map +1 -1
- package/build/components/Megamenu/style.css +1 -1
- package/build/components/Megamenu/style.css.map +1 -1
- package/build/components/Pagination/style.css +1 -1
- package/build/components/Pagination/style.css.map +1 -1
- package/build/components/PromotionCard/style.css +1 -1
- package/build/components/PromotionCard/style.css.map +1 -1
- package/build/components/Section/style.css +1 -1
- package/build/components/Section/style.css.map +1 -1
- package/build/components/SocialButton/style.css +1 -1
- package/build/components/SocialButton/style.css.map +1 -1
- package/build/components/Stepbar/style.css +1 -1
- package/build/components/Stepbar/style.css.map +1 -1
- package/build/components/Table/style.css +1 -1
- package/build/components/Table/style.css.map +1 -1
- package/build/components/Tabs/style.css +1 -1
- package/build/components/Tabs/style.css.map +1 -1
- package/build/components/Tag/style.css +1 -1
- package/build/components/Tag/style.css.map +1 -1
- package/build/components/Tile/style.css +1 -1
- package/build/components/Tile/style.css.map +1 -1
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/tsconfig.tsbuildinfo +1 -1
- package/build/components/types/index.d.ts +4 -15
- package/build/components/types/src/components/Carousel/Carousel.static.d.ts +4 -1
- package/build/components/types/src/components/Forms/Autocomplete/Autocomplete.static.d.ts +11 -0
- package/build/components/types/src/components/Forms/Group/Group.d.ts +1 -1
- package/build/components/types/src/components/Preview/CodeExample.d.ts +1 -0
- package/build/components/types/src/components/Preview/PreviewGenerator.d.ts +1 -0
- package/build/components/types/src/components/Preview/getElementDisplayName.d.ts +1 -0
- package/build/components/types/src/components/Tabs/Tabs.d.ts +0 -4
- package/build/components/types/src/components/Tabs/Tabs.static.d.ts +12 -0
- package/build/components/types/src/components/Tile/Tile.d.ts +3 -11
- package/build/lib/base.css +1 -1
- package/build/lib/base.css.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/footer.css +1 -1
- package/build/lib/footer.css.map +1 -1
- package/build/lib/megamenu.css +1 -1
- package/build/lib/megamenu.css.map +1 -1
- package/build/lib/scripts.js +1 -1
- package/build/lib/scripts.js.map +1 -1
- package/build/lib/style.css +1 -1
- package/build/lib/style.css.map +1 -1
- package/build/lib/tsconfig.tsbuildinfo +1 -1
- package/build/lib/utilities.css +1 -1
- package/build/lib/utilities.css.map +1 -1
- package/build/search-index.json +6 -6
- package/package.json +24 -24
- package/src/components/BlockAction/styles/style.scss +6 -4
- package/src/components/Breadcrumbs/styles/mixins.scss +15 -8
- package/src/components/Breadcrumbs/styles/style.scss +2 -1
- package/src/components/Carousel/Carousel.static.ts +29 -1
- package/src/components/Carousel/styles/mixins.scss +22 -2
- package/src/components/Carousel/tests/Carousel.static.test.jsx +50 -0
- package/src/components/DocumentationSidebar/DocumentationSidebar.tsx +21 -34
- package/src/components/DocumentationSidebar/styles/style.scss +0 -6
- package/src/components/Footer/styles/mixins.scss +2 -1
- package/src/components/Forms/Autocomplete/Autocomplete.static.ts +190 -14
- package/src/components/Forms/Autocomplete/styles/style.scss +61 -8
- package/src/components/Forms/Autocomplete/tests/Autocomplete.static.test.ts +187 -0
- package/src/components/Forms/Checkbox/styles/style.scss +13 -6
- package/src/components/Forms/DatePicker/styles/style.scss +1 -2
- package/src/components/Forms/Group/Group.tsx +4 -1
- package/src/components/Forms/Group/styles/config.scss +1 -1
- package/src/components/Forms/Group/styles/mixins.scss +17 -0
- package/src/components/Forms/Group/tests/Group.unit.test.jsx +9 -0
- package/src/components/Forms/InputStepper/styles/style.scss +15 -8
- package/src/components/Forms/TextArea/styles/config.scss +1 -0
- package/src/components/Forms/TextArea/styles/mixins.scss +7 -1
- package/src/components/Forms/TextInput/styles/config.scss +3 -1
- package/src/components/Forms/TextInput/styles/mixins.scss +7 -1
- package/src/components/Forms/TextInput/styles/style.scss +17 -12
- package/src/components/Forms/styles/config.scss +3 -2
- package/src/components/Icon/styles/style.scss +2 -1
- package/src/components/Link/styles/mixins.scss +0 -1
- package/src/components/Loader/styles/style.scss +0 -2
- package/src/components/Megamenu/Megamenu.tsx +2 -2
- package/src/components/Megamenu/MegamenuBlog.tsx +2 -2
- package/src/components/Megamenu/styles/mixins.scss +20 -12
- package/src/components/Pagination/styles/mixins.scss +8 -6
- package/src/components/Pagination/styles/style.scss +0 -4
- package/src/components/Preview/CodeExample.tsx +66 -25
- package/src/components/Preview/Preview.tsx +26 -13
- package/src/components/Preview/PreviewGenerator.tsx +72 -34
- package/src/components/Preview/getElementDisplayName.ts +25 -0
- package/src/components/PromotionCard/styles/mixins.scss +2 -1
- package/src/components/Section/styles/mixins.scss +27 -5
- package/src/components/SocialButton/styles/config.scss +2 -2
- package/src/components/Stepbar/styles/config.scss +34 -17
- package/src/components/Stepbar/styles/mixins.scss +5 -3
- package/src/components/Stepbar/styles/style.scss +4 -2
- package/src/components/Table/styles/mixins.scss +6 -3
- package/src/components/Tabs/Tabs.static.ts +157 -30
- package/src/components/Tabs/Tabs.tsx +62 -67
- package/src/components/Tabs/styles/config.scss +18 -25
- package/src/components/Tabs/styles/mixins.scss +93 -28
- package/src/components/Tabs/styles/style.scss +4 -15
- package/src/components/Tabs/tests/Tabs.unit.test.jsx +111 -0
- package/src/components/Tag/styles/config.scss +1 -1
- package/src/components/Tag/styles/style.scss +22 -5
- package/src/components/Tile/Tile.tsx +18 -42
- package/src/components/Tile/styles/mixins.scss +45 -47
- package/src/components/Tile/styles/style.scss +5 -17
- package/src/components/Tile/tests/Tile.unit.test.jsx +9 -78
- package/src/styles/base/globals.scss +2 -0
- package/src/styles/tokens/color-vars.scss +0 -2
- package/src/styles/utilities/color.scss +0 -153
- package/src/styles/utilities/horizontal-scroll.scss +7 -2
- package/src/styles/utilities/text.scss +0 -1
- package/src/components/Tile/CHANGELOG.md +0 -28
- package/src/components/Tile/styles/config.scss +0 -7
package/build/search-index.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"href": "/components/breadcrumbs",
|
|
36
|
-
"content": "export const breadcrumbsItems = [ { text: \"
|
|
36
|
+
"content": "export const breadcrumbsItems = [ { text: \"Domov\", url: \"#\", }, { text: \"Produkty a služby\", url: \"#\", }, { text: \"Vyskladajte si benefity v Love podľa seba\", url: \"#\", }, { text: \"Benefity Love na jednom mieste\", }, ]; Breadcrumbs Help users understand where they are within a website's structure and move between levels. ✅ <p> {Use the breadcrumbs component on every page, where you need to help users understand and move between the multiple levels of a website. That means virtually every page except the homepage and checkout.} </p> <p>Include the current page to indicate current location.</p> ❌ <p> {Don't use the breadcrumbs to show progress through a linear journey or transaction.} </p> Higlighting current page to screen readers If your application implements HTML5 landmarks (it should if possible), breadcrumbs should not be a part of the main region, current page hyperlink should point to the main region and be identified with aria-current=\"page\" attribute. Otherwise, current page should not be a hyperlink and the aria-current=\"page\" is applied to its wrapping <li />. Current page item as hyperlink Current page item without hyperlink Accessibility The breadcrumb component is built according to WAI-ARIA authoring practices 1.1. API React Props | Prop | Type | Default | Description | | ----------- | ---------------------------------- | ------- | --------------------------------------- | | items | { text: string, url?: string }[] | - | Required. Array of breadcrumb items | | label | string | - | Navigation label for accessibility | | className | string | - | Additional CSS classes | Notes - On small screens, breadcrumbs collapse and show only the parent page of the current location to provide a simple back button. - This component can be used as a separate package. The only asset required for proper use is a stylesheet, located in lib/breadcrumbs.css."
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
"href": "/components/button",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"href": "/components/forms/addons",
|
|
96
|
-
"content": "Search Icon Add search icon to TextInput using searchIcon=\"transient\". For Autocomplete, use .input--search-icon through autocompleteConfig.customInputClassName. Icon is visible
|
|
96
|
+
"content": "Search Icon Add search icon to TextInput using searchIcon=\"transient\". For Autocomplete, use .input--search-icon through autocompleteConfig.customInputClassName. Icon is visible in default, focused, filled, disabled and invalid states. It's required to set empty placeholder. Usage with placeholder is described in the example below. Does not apply for radios and checkboxes. <br /> <br /> <br /> Search icon with placeholder When displaying search icon on TextInput with placeholder, use searchIcon=\"persistent\". For Autocomplete, set .input--search-icon-with-placeholder through autocompleteConfig.customInputClassName. Autocomplete with placeholder search icon includes a clear button when it has value. Does not apply for radios and checkboxes. Usage with Autocomplete Disabled autocomplete Usage with Group button Action} control={{ type: \"autocomplete\", id: \"search-group-button\", options: [\"\", \"apple\", \"apricot\", \"banana\"], autocompleteConfig: { customInputClassName: \"input--search-icon-with-placeholder\", placeholder: \"Placeholder text\", }, placeholder: \"\", }} /> Disabled group button Action } control={{ type: \"autocomplete\", id: \"search-group-button-disabled\", options: [\"\", \"apple\", \"apricot\", \"banana\"], autocompleteConfig: { customInputClassName: \"input--search-icon-with-placeholder\", placeholder: \"Placeholder text\", }, placeholder: \"\", isDisabled: true, }} /> Usage with TextInput Regular input Large input Control Group Add prefixes and suffixes to control elements. Does not apply for radios and checkboxes. Example Variants With Button Ok } control={{ type: \"text\", id: \"group-2\" }} /> Size kg</span>, Send]} control={{ type: \"text\", size: \"large\", id: \"group-3\" }} />"
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"href": "/components/forms/autocomplete",
|
|
@@ -257,11 +257,11 @@
|
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
"href": "/components/tabs",
|
|
260
|
-
"content": "import React from \"react\"; Tabs Navigate sections of content in a tabbed interface. ... ... ... ... } > {[1, 2, 3, 4].map((item) => ( <p>{loremIpsum({ count: 3 })}</p> ))} Tabs - links Tabs can be also use as group of links. {[1, 2, 3, 4].map((item) => ( ))}
|
|
260
|
+
"content": "import React from \"react\"; Tabs Navigate sections of content in a tabbed interface. ... ... ... ... } > {[1, 2, 3, 4].map((item) => ( <p>{loremIpsum({ count: 3 })}</p> ))} Tabs - links Tabs can be also use as group of links. {[1, 2, 3, 4].map((item) => ( ))} Full width container ... ... ... ... } > {[1, 2, 3, 4].map((item) => ( <p>{loremIpsum({ count: 3 })}</p> ))} Equal width tabs ... ... ... ... } > {[1, 2, 3, 4].map((item) => ( <p>{loremIpsum({ count: 3 })}</p> ))} Custom tab content Only use inline elements as children of the tab titles. The tabs are <button> elements which do not allow using block elements inside themselves. <span className=\"h3 mb-xsmall\">Large tab 1</span> description </React.Fragment> } > <p>{loremIpsum({ count: 5 })}</p> <span className=\"h3 mb-xsmall\">Large tab 2</span> description </React.Fragment> } > <p>{loremIpsum({ count: 5 })}</p> Accessibility Tabs are implemented according to WAI-ARIA authoring practices - Example 2 Tabs with manual activation Notes: - Optional keyboard interaction (Home, End, Shift + 10, Delete) is not implemented. - Tabpanel elements lack aria-labelledby attributes due to a bug in VoiceOver, which reads the label instead of the content of the tabpanel. API React Props | Name | Type | Default | Description | | ------------------ | ------------------------------------- | ------------ | -------------------------------------------------------- | | activeTabIndex | number | 0 | Active Tab index. | | classesTabNav | string | - | Additional classes for tabs header. | | hasEqualTabWidth | boolean | false | All tabs have equal width inside a full-width container. | | isFullWidth | boolean | false | Full-width container. | | isLink | boolean | false | Tabs behave as links rather than tabs. | | children | React.ReactElement[] | required | Tab panels as children. | JS module reference Default Config | Property | Type | Default | Description | | ------------- | -------- | ---------------- | --------------------- | | tabSelector | string | '[role=\"tab\"]' | Tab element selector. | Methods | Method | Description | | ----------------------- | ---------------------------------------------------------- | | destroy() | Removes event listeners and cleans up the tabs instance. | | update() | Re-initializes the tabs with current configuration. | | activateNthTab(index) | Activates the tab at the specified index. | | getInstance(el) | Static method to get the Tabs instance from a DOM element. |"
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
"href": "/components/tag",
|
|
264
|
-
"content": "Tag
|
|
264
|
+
"content": "Tag Figma groups Tag into three showcases: Tag Interactive, Tag Action Button, and Tag Read Only. transparent is standalone color variant. Tag Interactive Buttons use onClick. Links use href. Button <div> {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} </div> Link <div> {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} </div> Tag Action Button Use actionButton for removable labels. <div> } > {\"Label\"} } > {\"Label\"} } > {\"Label\"} } > {\"Label\"} </div> Tag Read Only Sizes {\"Label\"} {\"Label\"} {\"Label\"} Brand colors {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} {\"Label\"} Semantic colors Info Warning Success Orange Accessibility - Use plain text tags only for non-interactive metadata - Use onClick when tag behaves like button - Use href when tag performs navigation - Always provide visible text that explains tag meaning - Always provide ariaLabel on TagButton - Check contrast when color communicates status API React Props | Name | Type | Default | Description | | -------------- | ------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | color | TagColor | - | Tag color. Options: \"black\", \"orange\", \"yellow\", \"green\", \"blue\", \"success\", \"info\", \"warning\", \"danger\", \"transparent\". | | size | \"small\" \\| \"large\" | - | Tag size. Omit prop for default medium size. | | isDisabled | boolean | false | Disables button state and adds aria-disabled for link, read-only, and action-button variants. | | className | string | - | Additional CSS classes. | | children | React.ReactNode | - | Visible tag label. | | actionButton | React.ReactElement | - | Action button rendered next to label, typically for remove or dismiss flows. | | onClick | React.MouseEventHandler | - | Makes tag render as <button>. | | href | string | - | Makes tag render as <a>. |"
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
267
|
"href": "/components/testimonial",
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
},
|
|
270
270
|
{
|
|
271
271
|
"href": "/components/tile",
|
|
272
|
-
"content": "Tile Tile
|
|
272
|
+
"content": "Tile Tile grid {Array.from({ length: 7 }).map((, index) => ( <h3 className=\"h5 bold\"> Default label </h3> ))} Tile row {Array.from({ length: 4 }).map((, index) => ( Default label ))} Action variant {Array.from({ length: 3 }).map((_, index) => ( Default label ))} API React Props | Name | Type | Default | Description | | ----------- | -------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------- | | variant | \"compact\" \\| \"action\" | - | Compact reduces spacing, uses row layout on mobile and stacks from sm up. Action adds row layout and chevron. | | hAlign | \"center\" | - | Horizontal alignment of tile content. | | vAlign | \"center\" \\| \"end\" \\| \"space-between\" | - | Vertical alignment of tile content. | | children | React.ReactNode | - | Tile content. | | className | string | - | Additional CSS classes. |"
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
275
|
"href": "/components/tooltip",
|
|
@@ -389,7 +389,7 @@
|
|
|
389
389
|
},
|
|
390
390
|
{
|
|
391
391
|
"href": "/utilities/color",
|
|
392
|
-
"content": "import Code from \"@/components/Code\"; Color Utilities Utility classes for applying colors based on our semantic design tokens. These classes automatically adapt to light and dark themes. 📖 For complete color system documentation, including theme switching and color philosophy, see our Color Palette & Theme System guide. ⚠️ Always check that your color combinations meet WCAG accessibility guidelines. Token-Based Utility Classes Our color utilities are automatically generated from semantic design tokens. Every class supports both light and dark themes through our .is-light and .is-dark system. Theme Switching Examples All color utilities work with our .is-light and .is-dark theme classes: <div className=\"is-light background-primary text-default p-4 border border-subtle rounded mb-4\"> <h4 className=\"bold\">Light Theme Section</h4> <p className=\"text-secondary\">Secondary text in light theme</p> <button className=\"surface-secondary text-inverse px-3 py-2 rounded\"> Orange Button </button> </div> <div className=\"is-dark background-primary text-default p-4 border border-subtle rounded\"> <h4 className=\"bold\">Dark Theme Section</h4> <p className=\"text-secondary\">Secondary text in dark theme</p> <button className=\"surface-secondary text-inverse px-3 py-2 rounded\"> Orange Button </button> </div> Text Color Utilities Use these classes to apply text colors: - .text-default - Default text color (black in light mode, white in dark mode) - .text-secondary - Secondary text color for less prominent content - .text-disabled - Disabled text color - .text-inverse - Inverse text color (white in light mode, black in dark mode) - .text-accent - Brand accent color (orange) - .text-information - Information/blue text - .text-positive - Success/green text - .text-warning - Warning/yellow text - .text-negative - Error/red text <p className=\"text-default\">Default text color</p> <p className=\"text-secondary\">Secondary text color</p> <p className=\"text-disabled\">Disabled text color</p> <p className=\"background-contrast text-inverse\"> {\"Inverse text color on dark background\"} </p> <p className=\"text-accent\">Accent text color</p> <p className=\"text-information\">Information text color</p> <p className=\"text-positive\">Success text color</p> <p className=\"text-warning\">Warning text color</p> <p className=\"text-negative\">Error text color</p> Icon Color Utilities Use these classes to apply colors to icons: - .icon-default - Default icon color - .icon-inverse - Inverse icon color - .icon-brand - Brand orange color - .icon-accent - Accent color variation - .icon-disabled - Disabled icon color - .icon-information - Information/blue color - .icon-positive - Success/green color - .icon-warning - Warning/yellow color - .icon-negative - Error/red color <span className=\"icon-default\"> </span> <span className=\"icon-inverse\"> </span> <span className=\"icon-brand\"> </span> <span className=\"icon-information\"> </span> <span className=\"icon-positive\"> </span> <span className=\"icon-warning\"> </span> <span className=\"icon-negative\"> </span> Background Utilities Primary Backgrounds - .background-primary - Primary background (white in light mode, dark in dark mode) - .background-secondary - Secondary background for subtle contrast - .background-contrast - High contrast background - .background-accent - Accent background for special content - .background-accent1-blog - Blog accent 1 background - .background-accent2-blog - Blog accent 2 background <p className=\"background-primary\">Primary background</p> <p className=\"background-secondary\">Secondary background</p> <p className=\"background-contrast text-inverse\">Contrast background</p> <p className=\"background-accent\">Accent background</p> <p className=\"background-accent1-blog\">Accent 1 Blog background</p> <p className=\"background-accent2-blog\">Accent 2 Blog background</p> Surface Utilities - .surface-primary - Primary surface - .surface-secondary - Brand orange surface - .surface-tertiary - Dark orange surface - .surface-subtle - Subtle surface for grouping - .surface-moderate - Moderate surface - .surface-contrast - High contrast surface - .surface-accent - Accent surface <p className=\"surface-primary\">Primary surface</p> <p className=\"surface-secondary text-inverse\">Secondary surface</p> <p className=\"surface-tertiary text-inverse\">Tertiary surface</p> <p className=\"surface-subtle\">Subtle surface</p> <p className=\"surface-moderate\">Moderate surface</p> <p className=\"surface-contrast text-inverse\">Contrast surface</p> <p className=\"surface-accent\">Accent surface</p> Fill Utilities - .fill-primary - Primary fill color - .fill-secondary - Secondary fill color (brand orange) - .fill-tertiary - Tertiary fill color (dark orange) - .fill-subtle - Subtle fill color - .fill-moderate - Moderate fill color - .fill-disabled - Disabled fill color - .fill-contrast - Contrast fill color - .fill-accent1 - Blue accent fill - .fill-accent2 - Green accent fill - .fill-accent3 - Pink accent fill - .fill-accent4 - Violet accent fill - .fill-accent5 - Yellow accent fill - .fill-information - Information background - .fill-positive - Success background - .fill-warning - Warning background - .fill-negative - Error background <p className=\"fill-primary\">Primary fill</p> <p className=\"fill-secondary text-inverse\">Secondary fill</p> <p className=\"fill-tertiary text-inverse\">Tertiary fill</p> <p className=\"fill-subtle\">Subtle fill</p> <p className=\"fill-moderate\">Moderate fill</p> <p className=\"fill-disabled\">Disabled fill</p> <p className=\"fill-contrast text-inverse\">Contrast fill</p> <p className=\"fill-accent1 text-inverse\">Blue accent fill</p> <p className=\"fill-accent2 text-inverse\">Green accent fill</p> <p className=\"fill-accent3 text-inverse\">Pink accent fill</p> <p className=\"fill-accent4 text-inverse\">Violet accent fill</p> <p className=\"fill-accent5 text-inverse\">Yellow accent fill</p> <p className=\"fill-information\">Information background</p> <p className=\"fill-positive\">Success background</p> <p className=\"fill-warning\">Warning background</p> <p className=\"fill-negative\">Error background</p> Border Utilities Use these classes to apply border colors: - .border-subtle - Subtle border - .border-strong - Strong border - .border-contrast - High contrast border - .border-accent - Brand accent border - .border-information - Information border - .border-positive - Success border - .border-warning - Warning border - .border-negative - Error border <div className=\"border border-subtle p-4 mb-small\">Subtle border</div> <div className=\"border border-strong p-4 mb-small\">Strong border</div> <div className=\"border border-contrast p-4 mb-small\">Contrast border</div> <div className=\"border border-accent p-4 mb-small\">Accent border</div> <div className=\"border border-information p-4 mb-small\"> Information border </div> <div className=\"border border-positive p-4 mb-small\">Success border</div> <div className=\"border border-warning p-4 mb-small\">Warning border</div> <div className=\"border border-negative p-4\">Error border</div> Legacy Classes (Deprecated) ⚠️ These classes are deprecated and will be removed in future versions. Please use the new token-based classes above. Legacy Text Colors These classes still work but will show deprecation warnings: .color-black → Use .text-default <p>Default text color is black</p> <p className=\"color-black\"> {\"But can be enforced with \"} <code>.color-black</code> {\" if needed. (Deprecated - use .text-default)\"} </p> .color-orange → Use .text-accent <p className=\"color-orange large bold\"> {\"Orange text (Deprecated - use .text-accent)\"} </p> .color-white → Use .text-inverse <p className=\"bg-black color-white\"> {\"White text (Deprecated - use .text-inverse)\"} </p> .color-gray → Use .text-secondary <p className=\"color-gray\">Gray text (Deprecated - use .text-secondary)</p> .color-blue → Use .icon-information <p className=\"color-blue\">Blue text (Deprecated - use .icon-information)</p> .color-danger → Use .icon-negative <p className=\"color-danger\">Danger text (Deprecated - use .icon-negative)</p> Legacy Background Colors These classes still work but will show deprecation warnings: .bg-white → Use .background-primary <p className=\"bg-white\"> {\"Default background (Deprecated - use .background-primary)\"} </p> .bg-black → Use .background-contrast <p className=\"bg-black\"> {\"Black background (Deprecated - use .background-contrast)\"} </p> .bg-orange → Use .surface-secondary <p className=\"bg-orange\"> {\"Orange background (Deprecated - use .surface-secondary)\"} </p> .bg-orange-dark → Use .surface-tertiary <p className=\"bg-orange-dark text-inverse\"> {\"Dark orange background (Deprecated - use .surface-tertiary)\"} </p> .bg-gray → Use .surface-subtle <p className=\"bg-gray\">Gray background (Deprecated - use .surface-subtle)</p> .bg-gray-lighter → Use .background-secondary <p className=\"bg-gray-lighter\"> {\"Light gray background (Deprecated - use .background-secondary)\"} </p> Accent Colors → Use .background- or .fill- <p className=\"bg-accent\"> {\"Accent background (Deprecated - use .background-accent)\"} </p> <p className=\"bg-accent1-blog\"> {\"Accent1 blog (Deprecated - use .background-accent1-blog)\"} </p> <p className=\"bg-accent2-blog\"> {\"Accent2 blog (Deprecated - use .background-accent2-blog)\"} </p> Supporting Colors → Use .fill-accent <p className=\"bg-blue\">Blue background (Deprecated - use .fill-accent1)</p> <p className=\"bg-green\">Green background (Deprecated - use .fill-accent2)</p> <p className=\"bg-pink\">Pink background (Deprecated - use .fill-accent3)</p> <p className=\"bg-violet\"> {\"Violet background (Deprecated - use .fill-accent4)\"} </p> <p className=\"bg-yellow\"> {\"Yellow background (Deprecated - use .fill-accent5)\"} </p> <p className=\"bg-red\">Red background (Deprecated - use .fill-negative)</p> Migration Guide When updating your code, use this mapping: Text Colors - .color-black → .text-default - .color-orange → .text-accent - .color-white → .text-inverse - .color-gray → .text-secondary - .color-blue → .icon-information - .color-danger → .icon-negative Background Colors - .bg-white → .background-primary - .bg-black → .background-contrast - .bg-orange → .surface-secondary - .bg-orange-dark → .surface-tertiary - .bg-gray → .surface-subtle - .bg-gray-lighter → .background-secondary - .bg-blue → .fill-accent1 - .bg-green → .fill-accent2 - .bg-pink → .fill-accent3 - .bg-violet → .fill-accent4 - .bg-yellow → .fill-accent5 - .bg-red → .fill-negative - .bg-accent → .background-accent - .bg-none → .background-none .bg-none → Use .background-none <p className=\"bg-none\">No background (Deprecated - use .background-none)</p> Special Utilities - .background-none - Removes background Best Practices 1. Use semantic names: Choose classes based on meaning rather than visual appearance 2. Consider theme compatibility: All token-based classes automatically adapt to light/dark themes 3. Test accessibility: Always verify color contrast meets WCAG guidelines 4. Migrate gradually: Legacy classes still work but show warnings to help with migration 5. Use border utilities: Apply consistent border colors using the new .border- classes 📖 For detailed guidance on theme switching, CSS variables, and color system architecture, see our Color Palette & Theme System documentation. Related Documentation - Color Palette & Theme System - Complete color system guide - Design Tokens - Token system overview - Accessibility - Color accessibility guidelines"
|
|
392
|
+
"content": "Color Utilities Utility classes for applying colors based on our semantic design tokens. These classes automatically adapt to light and dark themes. 📖 For complete color system documentation, including theme switching and color philosophy, see our Color Palette & Theme System guide. ⚠️ Always check that your color combinations meet WCAG accessibility guidelines. Token-Based Utility Classes Our color utilities are automatically generated from semantic design tokens. Every class supports both light and dark themes through our .is-light and .is-dark system. Theme Switching Examples All color utilities work with our .is-light and .is-dark theme classes: <div className=\"is-light background-primary text-default p-4 border border-subtle rounded mb-4\"> <h4 className=\"bold\">Light Theme Section</h4> <p className=\"text-secondary\">Secondary text in light theme</p> <button className=\"surface-secondary text-inverse px-3 py-2 rounded\"> Orange Button </button> </div> <div className=\"is-dark background-primary text-default p-4 border border-subtle rounded\"> <h4 className=\"bold\">Dark Theme Section</h4> <p className=\"text-secondary\">Secondary text in dark theme</p> <button className=\"surface-secondary text-inverse px-3 py-2 rounded\"> Orange Button </button> </div> Text Color Utilities Use these classes to apply text colors: - .text-default - Default text color (black in light mode, white in dark mode) - .text-secondary - Secondary text color for less prominent content - .text-disabled - Disabled text color - .text-inverse - Inverse text color (white in light mode, black in dark mode) - .text-accent - Brand accent color (orange) <p className=\"text-default\">Default text color</p> <p className=\"text-secondary\">Secondary text color</p> <p className=\"text-disabled\">Disabled text color</p> <p className=\"background-contrast text-inverse\"> {\"Inverse text color on dark background\"} </p> <p className=\"text-accent\">Accent text color</p> Icon Color Utilities Use these classes to apply colors to icons: - .icon-default - Default icon color - .icon-inverse - Inverse icon color - .icon-brand - Brand orange color - .icon-accent - Accent color variation - .icon-disabled - Disabled icon color - .icon-information - Information/blue color - .icon-positive - Success/green color - .icon-warning - Warning/yellow color - .icon-negative - Error/red color <span className=\"icon-default\"> </span> <span className=\"icon-inverse\"> </span> <span className=\"icon-brand\"> </span> <span className=\"icon-information\"> </span> <span className=\"icon-positive\"> </span> <span className=\"icon-warning\"> </span> <span className=\"icon-negative\"> </span> Background Utilities Primary Backgrounds - .background-primary - Primary background (white in light mode, dark in dark mode) - .background-secondary - Secondary background for subtle contrast - .background-contrast - High contrast background - .background-accent - Accent background for special content - .background-accent1-blog - Blog accent 1 background - .background-accent2-blog - Blog accent 2 background <p className=\"background-primary\">Primary background</p> <p className=\"background-secondary\">Secondary background</p> <p className=\"background-contrast text-inverse\">Contrast background</p> <p className=\"background-accent\">Accent background</p> <p className=\"background-accent1-blog\">Accent 1 Blog background</p> <p className=\"background-accent2-blog\">Accent 2 Blog background</p> Surface Utilities - .surface-primary - Primary surface - .surface-secondary - Brand orange surface - .surface-tertiary - Dark orange surface - .surface-subtle - Subtle surface for grouping - .surface-moderate - Moderate surface - .surface-contrast - High contrast surface - .surface-accent - Accent surface <p className=\"surface-primary\">Primary surface</p> <p className=\"surface-secondary text-inverse\">Secondary surface</p> <p className=\"surface-tertiary text-inverse\">Tertiary surface</p> <p className=\"surface-subtle\">Subtle surface</p> <p className=\"surface-moderate\">Moderate surface</p> <p className=\"surface-contrast text-inverse\">Contrast surface</p> <p className=\"surface-accent\">Accent surface</p> Fill Utilities - .fill-primary - Primary fill color - .fill-secondary - Secondary fill color (brand orange) - .fill-tertiary - Tertiary fill color (dark orange) - .fill-subtle - Subtle fill color - .fill-moderate - Moderate fill color - .fill-disabled - Disabled fill color - .fill-contrast - Contrast fill color - .fill-accent1 - Blue accent fill - .fill-accent2 - Green accent fill - .fill-accent3 - Pink accent fill - .fill-accent4 - Violet accent fill - .fill-accent5 - Yellow accent fill - .fill-information - Information background - .fill-positive - Success background - .fill-warning - Warning background - .fill-negative - Error background <p className=\"fill-primary\">Primary fill</p> <p className=\"fill-secondary text-inverse\">Secondary fill</p> <p className=\"fill-tertiary text-inverse\">Tertiary fill</p> <p className=\"fill-subtle\">Subtle fill</p> <p className=\"fill-moderate\">Moderate fill</p> <p className=\"fill-disabled\">Disabled fill</p> <p className=\"fill-contrast text-inverse\">Contrast fill</p> <p className=\"fill-accent1 text-inverse\">Blue accent fill</p> <p className=\"fill-accent2 text-inverse\">Green accent fill</p> <p className=\"fill-accent3 text-inverse\">Pink accent fill</p> <p className=\"fill-accent4 text-inverse\">Violet accent fill</p> <p className=\"fill-accent5 text-inverse\">Yellow accent fill</p> <p className=\"fill-information\">Information background</p> <p className=\"fill-positive\">Success background</p> <p className=\"fill-warning\">Warning background</p> <p className=\"fill-negative\">Error background</p> Border Utilities Use these classes to apply border colors: - .border-subtle - Subtle border - .border-strong - Strong border - .border-contrast - High contrast border - .border-accent - Brand accent border - .border-information - Information border - .border-positive - Success border - .border-warning - Warning border - .border-negative - Error border <div className=\"border border-subtle p-4 mb-small\">Subtle border</div> <div className=\"border border-strong p-4 mb-small\">Strong border</div> <div className=\"border border-contrast p-4 mb-small\">Contrast border</div> <div className=\"border border-accent p-4 mb-small\">Accent border</div> <div className=\"border border-information p-4 mb-small\"> Information border </div> <div className=\"border border-positive p-4 mb-small\">Success border</div> <div className=\"border border-warning p-4 mb-small\">Warning border</div> <div className=\"border border-negative p-4\">Error border</div> Special Utilities - .background-none - Removes background Best Practices 1. Use semantic names: Choose classes based on meaning rather than visual appearance 2. Consider theme compatibility: All token-based classes automatically adapt to light/dark themes 3. Test accessibility: Always verify color contrast meets WCAG guidelines 4. Use background-none: Remove background completely when you need transparent layout 5. Use border utilities: Apply consistent border colors using the new .border- classes 📖 For detailed guidance on theme switching, CSS variables, and color system architecture**, see our Color Palette & Theme System documentation. Related Documentation - Color Palette & Theme System - Complete color system guide - Design Tokens - Token system overview - Accessibility - Color accessibility guidelines"
|
|
393
393
|
},
|
|
394
394
|
{
|
|
395
395
|
"href": "/utilities/flex-alignment",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orangesk/orange-design-system",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.48",
|
|
4
4
|
"private": false,
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.x"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@cloudfour/transition-hidden-element": "^2.0.2",
|
|
56
56
|
"@mdx-js/loader": "^3.1.1",
|
|
57
57
|
"@mdx-js/react": "^3.1.1",
|
|
58
|
-
"@next/mdx": "16.2.
|
|
58
|
+
"@next/mdx": "16.2.6",
|
|
59
59
|
"@orangesk/accessible-autocomplete": "3.2.2",
|
|
60
60
|
"@popperjs/core": "^2.11.8",
|
|
61
61
|
"@types/mdx": "^2.0.13",
|
|
@@ -63,19 +63,19 @@
|
|
|
63
63
|
"classnames": "^2.5.1",
|
|
64
64
|
"daypickr": "^0.3.4",
|
|
65
65
|
"diff2html": "^3.4.56",
|
|
66
|
-
"dompurify": "^3.4.
|
|
67
|
-
"html-react-parser": "6.
|
|
66
|
+
"dompurify": "^3.4.5",
|
|
67
|
+
"html-react-parser": "6.1.2",
|
|
68
68
|
"lorem-ipsum": "3.0.0",
|
|
69
69
|
"minisearch": "7.2.0",
|
|
70
|
-
"next": "16.2.
|
|
70
|
+
"next": "16.2.6",
|
|
71
71
|
"normalize.css": "^8.0.1",
|
|
72
72
|
"nouislider": "^15.8.1",
|
|
73
73
|
"prism-react-renderer": "^2.4.1",
|
|
74
74
|
"query-string": "^9.3.1",
|
|
75
|
-
"react": "^19.2.
|
|
76
|
-
"react-dom": "^19.2.
|
|
75
|
+
"react": "^19.2.6",
|
|
76
|
+
"react-dom": "^19.2.6",
|
|
77
77
|
"react-element-to-jsx-string": "^17.0.1",
|
|
78
|
-
"react-is": "^19.2.
|
|
78
|
+
"react-is": "^19.2.6",
|
|
79
79
|
"rehype-autolink-headings": "^7.1.0",
|
|
80
80
|
"rehype-slug": "^6.0.0",
|
|
81
81
|
"remark-gemoji": "^8.0.0",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@babel/core": "^7.29.0",
|
|
90
|
-
"@babel/preset-env": "^7.29.
|
|
90
|
+
"@babel/preset-env": "^7.29.5",
|
|
91
91
|
"@babel/preset-react": "^7.28.5",
|
|
92
92
|
"@babel/preset-typescript": "^7.28.5",
|
|
93
93
|
"@biomejs/biome": "latest",
|
|
@@ -99,38 +99,38 @@
|
|
|
99
99
|
"@rollup/plugin-terser": "1.0.0",
|
|
100
100
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
101
101
|
"@rollup/plugin-url": "^8.0.2",
|
|
102
|
-
"@rollup/rollup-darwin-arm64": "^4.60.
|
|
102
|
+
"@rollup/rollup-darwin-arm64": "^4.60.4",
|
|
103
103
|
"@testing-library/dom": "^10.4.1",
|
|
104
104
|
"@testing-library/jest-dom": "^6.9.1",
|
|
105
105
|
"@testing-library/react": "^16.3.2",
|
|
106
106
|
"@testing-library/user-event": "^14.6.1",
|
|
107
|
-
"@types/node": "25.
|
|
108
|
-
"@types/react": "19.2.
|
|
107
|
+
"@types/node": "25.9.1",
|
|
108
|
+
"@types/react": "19.2.15",
|
|
109
109
|
"@types/react-dom": "19.2.3",
|
|
110
110
|
"@types/wnumb": "^1.2.3",
|
|
111
|
-
"@vitejs/plugin-react": "6.0.
|
|
112
|
-
"@vitest/browser": "^4.1.
|
|
113
|
-
"@vitest/browser-playwright": "^4.1.
|
|
114
|
-
"@vitest/coverage-v8": "^4.1.
|
|
115
|
-
"@vitest/ui": "^4.1.
|
|
111
|
+
"@vitejs/plugin-react": "6.0.2",
|
|
112
|
+
"@vitest/browser": "^4.1.7",
|
|
113
|
+
"@vitest/browser-playwright": "^4.1.7",
|
|
114
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
115
|
+
"@vitest/ui": "^4.1.7",
|
|
116
116
|
"canvas": "^3.2.3",
|
|
117
|
-
"fs-extra": "^11.3.
|
|
117
|
+
"fs-extra": "^11.3.5",
|
|
118
118
|
"glob": "13.0.6",
|
|
119
|
-
"html-validate": "
|
|
119
|
+
"html-validate": "11.2.0",
|
|
120
120
|
"husky": "^9.1.7",
|
|
121
121
|
"identity-obj-proxy": "^3.0.0",
|
|
122
122
|
"jsdom": "29.1.1",
|
|
123
|
-
"lint-staged": "
|
|
124
|
-
"playwright": "^1.
|
|
123
|
+
"lint-staged": "17.0.5",
|
|
124
|
+
"playwright": "^1.60.0",
|
|
125
125
|
"prettier": "^3.8.3",
|
|
126
|
-
"rollup": "^4.60.
|
|
126
|
+
"rollup": "^4.60.4",
|
|
127
127
|
"rollup-plugin-copy": "^3.5.0",
|
|
128
128
|
"rollup-plugin-dts": "^6.4.1",
|
|
129
129
|
"rollup-plugin-postcss": "^4.0.2",
|
|
130
|
-
"sass": "^1.
|
|
130
|
+
"sass": "^1.100.0",
|
|
131
131
|
"svg-sprite": "^2.0.4",
|
|
132
132
|
"typescript": "6.0.3",
|
|
133
|
-
"vitest": "^4.1.
|
|
133
|
+
"vitest": "^4.1.7",
|
|
134
134
|
"vitest-axe": "^0.1.0",
|
|
135
135
|
"vitest-browser-react": "^2.2.0"
|
|
136
136
|
},
|
|
@@ -15,19 +15,21 @@
|
|
|
15
15
|
&__indicator.is-indicating:not(.block-action__indicator--color-reset) {
|
|
16
16
|
@include mixins.indicator;
|
|
17
17
|
|
|
18
|
-
.
|
|
18
|
+
.background-primary &,
|
|
19
|
+
.surface-primary & {
|
|
19
20
|
@include mixins.indicator;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
.
|
|
23
|
+
.background-contrast &,
|
|
24
|
+
.surface-contrast & {
|
|
23
25
|
@include mixins.indicator("black");
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
.
|
|
28
|
+
.surface-secondary & {
|
|
27
29
|
@include mixins.indicator("orange");
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
.
|
|
32
|
+
.surface-tertiary & {
|
|
31
33
|
@include mixins.indicator("orange-dark");
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -26,9 +26,7 @@
|
|
|
26
26
|
@mixin container {
|
|
27
27
|
@include container.base;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
flex-wrap: wrap;
|
|
31
|
-
align-items: center;
|
|
29
|
+
font-size: 0;
|
|
32
30
|
margin-top: 0;
|
|
33
31
|
margin-bottom: 0;
|
|
34
32
|
}
|
|
@@ -50,21 +48,28 @@
|
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
@mixin item {
|
|
53
|
-
display:
|
|
54
|
-
|
|
51
|
+
display: inline;
|
|
52
|
+
font-size: base.$font-size !important;
|
|
53
|
+
line-height: inherit;
|
|
55
54
|
color: var(--color-text-secondary);
|
|
56
55
|
margin-bottom: 0;
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
&:not(:last-child)::after {
|
|
59
58
|
@include separator();
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
&::before {
|
|
63
62
|
@include breakpoint.get("sm") {
|
|
64
63
|
display: none;
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
66
|
|
|
67
|
+
&:nth-last-child(2)::after {
|
|
68
|
+
@include breakpoint.get("xs", "down") {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
68
73
|
&:nth-last-child(2) {
|
|
69
74
|
@include breakpoint.get("xs", "down") {
|
|
70
75
|
display: inline-block;
|
|
@@ -75,6 +80,7 @@
|
|
|
75
80
|
|
|
76
81
|
&:nth-last-child(2)::before {
|
|
77
82
|
@include breakpoint.get("xs", "down") {
|
|
83
|
+
@include separator();
|
|
78
84
|
transform: rotate(180deg);
|
|
79
85
|
position: absolute;
|
|
80
86
|
top: 50%;
|
|
@@ -94,7 +100,8 @@
|
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
@mixin item-dark {
|
|
97
|
-
&::before
|
|
103
|
+
&::before,
|
|
104
|
+
&::after {
|
|
98
105
|
@include separator-white();
|
|
99
106
|
}
|
|
100
107
|
}
|
|
@@ -31,6 +31,11 @@ import {
|
|
|
31
31
|
SELECTOR_VIEWPORT,
|
|
32
32
|
} from "./constants";
|
|
33
33
|
|
|
34
|
+
interface ExternalControlsState {
|
|
35
|
+
isAtStart: boolean;
|
|
36
|
+
isAtEnd: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
export const defaultConfig: SwiperOptions = {
|
|
35
40
|
navigation: {
|
|
36
41
|
nextEl: SELECTOR_NEXT,
|
|
@@ -94,6 +99,8 @@ export default class Carousel {
|
|
|
94
99
|
track!: HTMLElement;
|
|
95
100
|
instance!: Swiper;
|
|
96
101
|
carouselId?: string;
|
|
102
|
+
private isScrollbarDragging = false;
|
|
103
|
+
private externalControlsState: ExternalControlsState | null = null;
|
|
97
104
|
private resizeObserver?: ResizeObserver;
|
|
98
105
|
private resizeRafId?: number;
|
|
99
106
|
private boundWindowResizeHandler: () => void;
|
|
@@ -215,6 +222,13 @@ export default class Carousel {
|
|
|
215
222
|
slideChangeTransitionEnd: () => {
|
|
216
223
|
this.updateExternalControlsState();
|
|
217
224
|
},
|
|
225
|
+
scrollbarDragStart: () => {
|
|
226
|
+
this.isScrollbarDragging = true;
|
|
227
|
+
},
|
|
228
|
+
scrollbarDragEnd: () => {
|
|
229
|
+
this.isScrollbarDragging = false;
|
|
230
|
+
this.updateExternalControlsState(true);
|
|
231
|
+
},
|
|
218
232
|
},
|
|
219
233
|
});
|
|
220
234
|
|
|
@@ -697,7 +711,7 @@ export default class Carousel {
|
|
|
697
711
|
* Update the disabled state of external navigation controls.
|
|
698
712
|
* Controls are disabled at the start/end of the carousel based on slide position.
|
|
699
713
|
*/
|
|
700
|
-
updateExternalControlsState() {
|
|
714
|
+
updateExternalControlsState(force = false) {
|
|
701
715
|
if (!this.carouselId || !this.instance) {
|
|
702
716
|
return;
|
|
703
717
|
}
|
|
@@ -706,10 +720,22 @@ export default class Carousel {
|
|
|
706
720
|
return;
|
|
707
721
|
}
|
|
708
722
|
|
|
723
|
+
if (this.isScrollbarDragging && !force) {
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
|
|
709
727
|
const isDisabled = !this.instance.enabled;
|
|
710
728
|
const isAtStart = isDisabled || this.instance.isBeginning;
|
|
711
729
|
const isAtEnd = isDisabled || this.instance.isEnd;
|
|
712
730
|
|
|
731
|
+
this.externalControlsState = { isAtStart, isAtEnd };
|
|
732
|
+
|
|
733
|
+
this.applyExternalControlsState(this.externalControlsState);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
private applyExternalControlsState(state: ExternalControlsState) {
|
|
737
|
+
const { isAtStart, isAtEnd } = state;
|
|
738
|
+
|
|
713
739
|
const prevControls = document.querySelectorAll(
|
|
714
740
|
`[data-carousel-controls="${this.carouselId}"][data-carousel-action="prev"]`,
|
|
715
741
|
);
|
|
@@ -816,6 +842,8 @@ export default class Carousel {
|
|
|
816
842
|
this.instance.destroy();
|
|
817
843
|
}
|
|
818
844
|
|
|
845
|
+
this.isScrollbarDragging = false;
|
|
846
|
+
this.externalControlsState = null;
|
|
819
847
|
this.resizeObserver?.disconnect();
|
|
820
848
|
this.resizeObserver = undefined;
|
|
821
849
|
|
|
@@ -188,13 +188,32 @@
|
|
|
188
188
|
|
|
189
189
|
@mixin scrollbar-base {
|
|
190
190
|
position: relative;
|
|
191
|
+
overflow: visible;
|
|
191
192
|
}
|
|
192
193
|
|
|
193
194
|
@mixin scrollbar-horizontal {
|
|
194
|
-
height: convert.to-rem(
|
|
195
|
+
height: convert.to-rem(8px);
|
|
195
196
|
appearance: none;
|
|
196
|
-
background-color:
|
|
197
|
+
background-color: transparent;
|
|
197
198
|
border-radius: 99px;
|
|
199
|
+
|
|
200
|
+
&::before {
|
|
201
|
+
content: "";
|
|
202
|
+
position: absolute;
|
|
203
|
+
top: convert.to-rem(1px);
|
|
204
|
+
right: 0;
|
|
205
|
+
bottom: convert.to-rem(1px);
|
|
206
|
+
left: 0;
|
|
207
|
+
background-color: var(--color-surface-moderate);
|
|
208
|
+
border-radius: 99px;
|
|
209
|
+
pointer-events: none;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&:hover .carousel__scrollbar-drag,
|
|
213
|
+
.carousel__scrollbar-drag:hover {
|
|
214
|
+
height: convert.to-rem(8px);
|
|
215
|
+
margin-top: 0;
|
|
216
|
+
}
|
|
198
217
|
}
|
|
199
218
|
|
|
200
219
|
@mixin scrollbar-drag {
|
|
@@ -202,6 +221,7 @@
|
|
|
202
221
|
background-color: var(--color-fill-contrast);
|
|
203
222
|
border-radius: 99px;
|
|
204
223
|
height: convert.to-rem(6px);
|
|
224
|
+
margin-top: convert.to-rem(1px);
|
|
205
225
|
|
|
206
226
|
&:hover {
|
|
207
227
|
background-color: var(--color-fill-secondary) !important;
|
|
@@ -283,6 +283,56 @@ describe("Carousel Static - External Controls", () => {
|
|
|
283
283
|
expect(updateStatesSpy).toHaveBeenCalled();
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
|
+
|
|
287
|
+
it("should keep external controls disabled while scrollbar drag is active", () => {
|
|
288
|
+
mockSwiperInstance.isBeginning = false;
|
|
289
|
+
mockSwiperInstance.isEnd = true;
|
|
290
|
+
|
|
291
|
+
carouselInstance.updateExternalControlsState();
|
|
292
|
+
|
|
293
|
+
const nextButton = document.getElementById("next-btn");
|
|
294
|
+
expect(nextButton).toHaveAttribute("disabled", "true");
|
|
295
|
+
|
|
296
|
+
const swiperConfig = Swiper.mock.calls[0]?.[1];
|
|
297
|
+
const slideChange = swiperConfig?.on?.slideChange;
|
|
298
|
+
const scrollbarDragStart = swiperConfig?.on?.scrollbarDragStart;
|
|
299
|
+
|
|
300
|
+
scrollbarDragStart?.();
|
|
301
|
+
|
|
302
|
+
expect(nextButton).toHaveAttribute("disabled", "true");
|
|
303
|
+
expect(nextButton).toHaveAttribute("aria-disabled", "true");
|
|
304
|
+
|
|
305
|
+
mockSwiperInstance.isBeginning = false;
|
|
306
|
+
mockSwiperInstance.isEnd = false;
|
|
307
|
+
|
|
308
|
+
slideChange?.();
|
|
309
|
+
|
|
310
|
+
expect(nextButton).toHaveAttribute("disabled", "true");
|
|
311
|
+
expect(nextButton).toHaveAttribute("aria-disabled", "true");
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
it("should sync external controls after scrollbar drag end", () => {
|
|
315
|
+
mockSwiperInstance.isBeginning = false;
|
|
316
|
+
mockSwiperInstance.isEnd = true;
|
|
317
|
+
|
|
318
|
+
carouselInstance.updateExternalControlsState();
|
|
319
|
+
|
|
320
|
+
const nextButton = document.getElementById("next-btn");
|
|
321
|
+
expect(nextButton).toHaveAttribute("disabled", "true");
|
|
322
|
+
|
|
323
|
+
const swiperConfig = Swiper.mock.calls[0]?.[1];
|
|
324
|
+
const scrollbarDragStart = swiperConfig?.on?.scrollbarDragStart;
|
|
325
|
+
const scrollbarDragEnd = swiperConfig?.on?.scrollbarDragEnd;
|
|
326
|
+
|
|
327
|
+
mockSwiperInstance.isBeginning = false;
|
|
328
|
+
mockSwiperInstance.isEnd = false;
|
|
329
|
+
|
|
330
|
+
scrollbarDragStart?.();
|
|
331
|
+
scrollbarDragEnd?.();
|
|
332
|
+
|
|
333
|
+
expect(nextButton).not.toHaveAttribute("disabled");
|
|
334
|
+
expect(nextButton).toHaveAttribute("aria-disabled", "false");
|
|
335
|
+
});
|
|
286
336
|
});
|
|
287
337
|
|
|
288
338
|
describe("Multiple Control Sets", () => {
|
|
@@ -381,7 +381,7 @@ export const DocumentationSidebar: React.FC<DocumentationSidebarProps> = (
|
|
|
381
381
|
>
|
|
382
382
|
<Image src="/logo.svg" alt="logo" />
|
|
383
383
|
|
|
384
|
-
<div className=
|
|
384
|
+
<div className="mb">
|
|
385
385
|
<TextInput
|
|
386
386
|
id="search-documentation"
|
|
387
387
|
htmlType="search"
|
|
@@ -393,42 +393,29 @@ export const DocumentationSidebar: React.FC<DocumentationSidebarProps> = (
|
|
|
393
393
|
aria-label="Search documentation"
|
|
394
394
|
ref={searchInputRef}
|
|
395
395
|
/>
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
className={`${CLASS_ROOT}__search-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
396
|
+
|
|
397
|
+
{searchResults.length > 0 && (
|
|
398
|
+
<div className={`${CLASS_ROOT}__search-results`}>
|
|
399
|
+
<ul className={`${CLASS_ROOT}__search-list`}>
|
|
400
|
+
{searchResults.map((result, index) => (
|
|
401
|
+
<li key={result.id}>
|
|
402
|
+
<Link
|
|
403
|
+
href={result.href}
|
|
404
|
+
className={cx(`${CLASS_ROOT}__search-result-link`, {
|
|
405
|
+
[`${CLASS_ROOT}__search-result-link--active`]:
|
|
406
|
+
index === activeSearchIndex,
|
|
407
|
+
})}
|
|
408
|
+
onClick={() => handleSelect(result.href)}
|
|
409
|
+
>
|
|
410
|
+
{result.label}
|
|
411
|
+
</Link>
|
|
412
|
+
</li>
|
|
413
|
+
))}
|
|
414
|
+
</ul>
|
|
415
|
+
</div>
|
|
408
416
|
)}
|
|
409
417
|
</div>
|
|
410
418
|
|
|
411
|
-
{searchResults.length > 0 && (
|
|
412
|
-
<div className={`${CLASS_ROOT}__search-results`}>
|
|
413
|
-
<ul className={`${CLASS_ROOT}__search-list`}>
|
|
414
|
-
{searchResults.map((result, index) => (
|
|
415
|
-
<li key={result.id}>
|
|
416
|
-
<Link
|
|
417
|
-
href={result.href}
|
|
418
|
-
className={cx(`${CLASS_ROOT}__search-result-link`, {
|
|
419
|
-
[`${CLASS_ROOT}__search-result-link--active`]:
|
|
420
|
-
index === activeSearchIndex,
|
|
421
|
-
})}
|
|
422
|
-
onClick={() => handleSelect(result.href)}
|
|
423
|
-
>
|
|
424
|
-
{result.label}
|
|
425
|
-
</Link>
|
|
426
|
-
</li>
|
|
427
|
-
))}
|
|
428
|
-
</ul>
|
|
429
|
-
</div>
|
|
430
|
-
)}
|
|
431
|
-
|
|
432
419
|
<nav
|
|
433
420
|
className={`${CLASS_ROOT}__nav`}
|
|
434
421
|
style={{ display: searchResults.length > 0 ? "none" : "block" }}
|