diff --git a/.postcssrc.js b/.postcssrc.js index da13a99d..9d3e32b9 100644 --- a/.postcssrc.js +++ b/.postcssrc.js @@ -10,7 +10,7 @@ module.exports = { generateScopedName: classConfig, getJSON: (cssFileName, json) => { /* Ignore generate common polaris tokens style file */ - if (cssFileName.indexOf('@shopify/polaris-tokens') !== -1 || cssFileName.indexOf('CustomProperties') !== -1) { + if (cssFileName.indexOf('@shopify/polaris-tokens') !== -1) { return; } diff --git a/.storybook/stories/GetStarted.stories.mdx b/.storybook/stories/GetStarted.stories.mdx index 12a615f4..88c62655 100644 --- a/.storybook/stories/GetStarted.stories.mdx +++ b/.storybook/stories/GetStarted.stories.mdx @@ -24,7 +24,7 @@ import { Meta } from '@storybook/addon-docs'; Polaris Vue by Ownego is a component library for [Vue 3](https://vuejs.org/) based on [Shopify Polaris style guide](https://polaris.shopify.com/). We try to keep the package light-weight and easy to use (mostly similar with original Polaris Library). -**Follow Polaris React version:** [9.23.1](https://github.com/Shopify/polaris/releases/tag/%40shopify%2Fpolaris%409.23.1) - Migrated date: *Aug 18th, 2022*. +**Follow Polaris React version:** [10.0.0](https://github.com/Shopify/polaris/releases/tag/%40shopify%2Fpolaris%4010.0.0) - Migrated date: *Aug 27th, 2022*. Github diff --git a/README.md b/README.md index 80b3ba6d..8776f0ee 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Polaris Vue by Ownego only supports **Vue 3.0+**. Polaris Vue based on [Shopify Polaris style guide](https://polaris.shopify.com/), built especially for Vue 3. We're trying to make it mostly close with Shopify style guide and get a better performance. -**Follow Polaris React version:** [9.23.1](https://github.com/Shopify/polaris/releases/tag/%40shopify%2Fpolaris%409.23.1) - Migrated date: *Aug 18th, 2022*. +**Follow Polaris React version:** [10.0.0](https://github.com/Shopify/polaris/releases/tag/%40shopify%2Fpolaris%4010.0.0) - Migrated date: *Aug 27th, 2022*.
diff --git a/build/namespaced-classname.js b/build/namespaced-classname.js index 9da55f8b..d6574d58 100644 --- a/build/namespaced-classname.js +++ b/build/namespaced-classname.js @@ -11,7 +11,7 @@ const NESTED_COMPONENT_PATH_REGEX = /.*\/components\/(.*)\/components/; const scopedHashes = {}; module.exports = function generateScopedName(name, filename, css) { - if (filename.includes('@shopify/polaris-tokens') || filename.includes('CustomProperties')) { + if (filename.includes('@shopify/polaris-tokens')) { return name; } diff --git a/package.json b/package.json index 49b1cc1a..6ca03ede 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ownego/polaris-vue", - "version": "1.0.6", - "polaris_version": "9.23.1", + "version": "1.1.0", + "polaris_version": "10.0.0", "description": "Shopify Polaris UI library for Vue 3", "author": "Ownego Team", "keywords": [ @@ -44,7 +44,7 @@ "devDependencies": { "@babel/core": "^7.17.5", "@rushstack/eslint-patch": "^1.1.0", - "@shopify/polaris-tokens": "^5.5.1", + "@shopify/polaris-tokens": "^6.0.0", "@shopify/typescript-configs": "^5.1.0", "@storybook/addon-a11y": "^6.5.5", "@storybook/addon-actions": "^6.5.5", diff --git a/src/classes/IndexTable.json b/src/classes/IndexTable.json index f8421328..94c01123 100644 --- a/src/classes/IndexTable.json +++ b/src/classes/IndexTable.json @@ -1 +1 @@ -{"IndexTable":"Polaris-IndexTable","LoadingContainer-enter":"Polaris-IndexTable__LoadingContainer--enter","LoadingContainer-enter-active":"Polaris-IndexTable--loadingContainerEnterActive","LoadingContainer-exit":"Polaris-IndexTable__LoadingContainer--exit","LoadingContainer-exit-active":"Polaris-IndexTable--loadingContainerExitActive","LoadingPanel":"Polaris-IndexTable__LoadingPanel","LoadingPanelRow":"Polaris-IndexTable__LoadingPanelRow","LoadingPanelText":"Polaris-IndexTable__LoadingPanelText","Table":"Polaris-IndexTable__Table","Table-scrolling":"Polaris-IndexTable__Table--scrolling","TableCell-first":"Polaris-IndexTable__TableCell--first","TableCell":"Polaris-IndexTable__TableCell","TableHeading-first":"Polaris-IndexTable__TableHeading--first","TableHeading-second":"Polaris-IndexTable__TableHeading--second","Table-unselectable":"Polaris-IndexTable__Table--unselectable","TableRow":"Polaris-IndexTable__TableRow","TableRow-unclickable":"Polaris-IndexTable__TableRow--unclickable","statusSuccess":"Polaris-IndexTable--statusSuccess","statusSubdued":"Polaris-IndexTable--statusSubdued","TableRow-hovered":"Polaris-IndexTable__TableRow--hovered","TableRow-selected":"Polaris-IndexTable__TableRow--selected","TableRow-subdued":"Polaris-IndexTable__TableRow--subdued","TableRow-disabled":"Polaris-IndexTable__TableRow--disabled","TableHeading":"Polaris-IndexTable__TableHeading","TableHeading-flush":"Polaris-IndexTable__TableHeading--flush","ColumnHeaderCheckboxWrapper":"Polaris-IndexTable__ColumnHeaderCheckboxWrapper","FirstStickyHeaderElement":"Polaris-IndexTable__FirstStickyHeaderElement","TableHeading-unselectable":"Polaris-IndexTable__TableHeading--unselectable","TableCell-flush":"Polaris-IndexTable__TableCell--flush","Table-sticky-scrolling":"Polaris-IndexTable--tableStickyScrolling","TableHeading-last":"Polaris-IndexTable__TableHeading--last","Table-sticky-last":"Polaris-IndexTable--tableStickyLast","StickyTable":"Polaris-IndexTable__StickyTable","StickyTableHeader":"Polaris-IndexTable__StickyTableHeader","StickyTableHeader-isSticky":"Polaris-IndexTable__StickyTableHeader--isSticky","StickyTableColumnHeader":"Polaris-IndexTable__StickyTableColumnHeader","StickyTableColumnHeader-isScrolling":"Polaris-IndexTable__StickyTableColumnHeader--isScrolling","StickyTableHeadings":"Polaris-IndexTable__StickyTableHeadings","StickyTableHeading-second":"Polaris-IndexTable__StickyTableHeading--second","unselectable":"Polaris-IndexTable--unselectable","StickyTableHeading-second-scrolling":"Polaris-IndexTable--stickyTableHeadingSecondScrolling","ScrollLeft":"Polaris-IndexTable__ScrollLeft","ScrollRight":"Polaris-IndexTable__ScrollRight","ScrollRight-onboarding":"Polaris-IndexTable__ScrollRight--onboarding","BulkActionsWrapper":"Polaris-IndexTable__BulkActionsWrapper","ScrollBarContainer":"Polaris-IndexTable__ScrollBarContainer","scrollBarContainerCondensed":"Polaris-IndexTable--scrollBarContainerCondensed","scrollBarContainerHidden":"Polaris-IndexTable--scrollBarContainerHidden","ScrollBar":"Polaris-IndexTable__ScrollBar","disableTextSelection":"Polaris-IndexTable--disableTextSelection","selectMode":"Polaris-IndexTable--selectMode","EmptySearchResultWrapper":"Polaris-IndexTable__EmptySearchResultWrapper","condensedRow":"Polaris-IndexTable--condensedRow","CondensedList":"Polaris-IndexTable__CondensedList","HeaderWrapper":"Polaris-IndexTable__HeaderWrapper","StickyTable-condensed":"Polaris-IndexTable__StickyTable--condensed","StickyTableHeader-condensed":"Polaris-IndexTable__StickyTableHeader--condensed","ScrollBarContent":"Polaris-IndexTable__ScrollBarContent"} \ No newline at end of file +{"IndexTable":"Polaris-IndexTable","LoadingContainer-enter":"Polaris-IndexTable__LoadingContainer--enter","LoadingContainer-enter-active":"Polaris-IndexTable--loadingContainerEnterActive","LoadingContainer-exit":"Polaris-IndexTable__LoadingContainer--exit","LoadingContainer-exit-active":"Polaris-IndexTable--loadingContainerExitActive","LoadingPanel":"Polaris-IndexTable__LoadingPanel","LoadingPanelRow":"Polaris-IndexTable__LoadingPanelRow","LoadingPanelText":"Polaris-IndexTable__LoadingPanelText","Table":"Polaris-IndexTable__Table","Table-scrolling":"Polaris-IndexTable__Table--scrolling","TableCell-first":"Polaris-IndexTable__TableCell--first","TableCell":"Polaris-IndexTable__TableCell","TableHeading-first":"Polaris-IndexTable__TableHeading--first","TableHeading-second":"Polaris-IndexTable__TableHeading--second","Table-unselectable":"Polaris-IndexTable__Table--unselectable","TableRow":"Polaris-IndexTable__TableRow","TableRow-unclickable":"Polaris-IndexTable__TableRow--unclickable","statusSuccess":"Polaris-IndexTable--statusSuccess","statusSubdued":"Polaris-IndexTable--statusSubdued","TableRow-hovered":"Polaris-IndexTable__TableRow--hovered","TableRow-selected":"Polaris-IndexTable__TableRow--selected","TableRow-subdued":"Polaris-IndexTable__TableRow--subdued","TableRow-disabled":"Polaris-IndexTable__TableRow--disabled","TableHeading":"Polaris-IndexTable__TableHeading","TableHeading-sortable":"Polaris-IndexTable__TableHeading--sortable","TableHeading-flush":"Polaris-IndexTable__TableHeading--flush","TableHeadingSortButton":"Polaris-IndexTable__TableHeadingSortButton","TableHeadingSortIcon":"Polaris-IndexTable__TableHeadingSortIcon","TableHeadingSortIcon-visible":"Polaris-IndexTable__TableHeadingSortIcon--visible","ColumnHeaderCheckboxWrapper":"Polaris-IndexTable__ColumnHeaderCheckboxWrapper","FirstStickyHeaderElement":"Polaris-IndexTable__FirstStickyHeaderElement","TableHeading-unselectable":"Polaris-IndexTable__TableHeading--unselectable","TableCell-flush":"Polaris-IndexTable__TableCell--flush","Table-sticky-scrolling":"Polaris-IndexTable--tableStickyScrolling","TableHeading-last":"Polaris-IndexTable__TableHeading--last","Table-sticky-last":"Polaris-IndexTable--tableStickyLast","StickyTable":"Polaris-IndexTable__StickyTable","StickyTableHeader":"Polaris-IndexTable__StickyTableHeader","StickyTableHeader-isSticky":"Polaris-IndexTable__StickyTableHeader--isSticky","StickyTableColumnHeader":"Polaris-IndexTable__StickyTableColumnHeader","StickyTableColumnHeader-isScrolling":"Polaris-IndexTable__StickyTableColumnHeader--isScrolling","StickyTableHeadings":"Polaris-IndexTable__StickyTableHeadings","StickyTableHeading-second":"Polaris-IndexTable__StickyTableHeading--second","unselectable":"Polaris-IndexTable--unselectable","StickyTableHeading-second-scrolling":"Polaris-IndexTable--stickyTableHeadingSecondScrolling","ScrollLeft":"Polaris-IndexTable__ScrollLeft","ScrollRight":"Polaris-IndexTable__ScrollRight","ScrollRight-onboarding":"Polaris-IndexTable__ScrollRight--onboarding","BulkActionsWrapper":"Polaris-IndexTable__BulkActionsWrapper","ScrollBarContainer":"Polaris-IndexTable__ScrollBarContainer","scrollBarContainerCondensed":"Polaris-IndexTable--scrollBarContainerCondensed","scrollBarContainerHidden":"Polaris-IndexTable--scrollBarContainerHidden","ScrollBar":"Polaris-IndexTable__ScrollBar","disableTextSelection":"Polaris-IndexTable--disableTextSelection","selectMode":"Polaris-IndexTable--selectMode","EmptySearchResultWrapper":"Polaris-IndexTable__EmptySearchResultWrapper","condensedRow":"Polaris-IndexTable--condensedRow","CondensedList":"Polaris-IndexTable__CondensedList","HeaderWrapper":"Polaris-IndexTable__HeaderWrapper","StickyTable-condensed":"Polaris-IndexTable__StickyTable--condensed","StickyTableHeader-condensed":"Polaris-IndexTable__StickyTableHeader--condensed","ScrollBarContent":"Polaris-IndexTable__ScrollBarContent"} \ No newline at end of file diff --git a/src/classes/InlineCode.json b/src/classes/InlineCode.json new file mode 100644 index 00000000..40d0cb24 --- /dev/null +++ b/src/classes/InlineCode.json @@ -0,0 +1 @@ +{"Code":"Polaris-InlineCode__Code"} \ No newline at end of file diff --git a/src/classes/Text.json b/src/classes/Text.json new file mode 100644 index 00000000..02170fc2 --- /dev/null +++ b/src/classes/Text.json @@ -0,0 +1 @@ +{"root":"Polaris-Text--root","block":"Polaris-Text--block","truncate":"Polaris-Text--truncate","visuallyHidden":"Polaris-Text--visuallyHidden","start":"Polaris-Text--start","center":"Polaris-Text--center","end":"Polaris-Text--end","justify":"Polaris-Text--justify","success":"Polaris-Text--success","critical":"Polaris-Text--critical","warning":"Polaris-Text--warning","subdued":"Polaris-Text--subdued","regular":"Polaris-Text--regular","medium":"Polaris-Text--medium","semibold":"Polaris-Text--semibold","bold":"Polaris-Text--bold","headingXs":"Polaris-Text--headingXs","headingSm":"Polaris-Text--headingSm","headingMd":"Polaris-Text--headingMd","headingLg":"Polaris-Text--headingLg","headingXl":"Polaris-Text--headingXl","heading2xl":"Polaris-Text--heading2xl","heading3xl":"Polaris-Text--heading3xl","heading4xl":"Polaris-Text--heading4xl","bodySm":"Polaris-Text--bodySm","bodyMd":"Polaris-Text--bodyMd","bodyLg":"Polaris-Text--bodyLg"} \ No newline at end of file diff --git a/src/components/AppProvider/AppProvider.vue b/src/components/AppProvider/AppProvider.vue index 17f01f93..cf943e59 100644 --- a/src/components/AppProvider/AppProvider.vue +++ b/src/components/AppProvider/AppProvider.vue @@ -1,31 +1,24 @@ - - diff --git a/src/components/CustomProperties/README.stories.mdx b/src/components/CustomProperties/README.stories.mdx deleted file mode 100644 index 87cc9dd6..00000000 --- a/src/components/CustomProperties/README.stories.mdx +++ /dev/null @@ -1,121 +0,0 @@ -import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs'; -import { CustomProperties, AppProvider, Card, TextContainer, CardSection, List, ListItem } from '@/polaris-vue'; -import dedent from 'ts-dedent'; -import { ref } from 'vue'; - - - -export const Template = (args) => ({ - components: { AppProvider, CustomProperties, Card, TextContainer, CardSection, List, ListItem }, - setup() { - return { args }; - }, - template: dedent` - - - - - - 1 × Oasis Glass, 4-Pack - 1 × Anubis Cup, 2-Pack - - - - - - - - 1 × Oasis Glass, 4-Pack - 1 × Anubis Cup, 2-Pack - - - - - - - `, -}); - -# CustomProperties - -Use the custom properties component to share global theme settings throughout the hierarchy of your application. Custom properties is included by default as a child of the [app provider component](./?path=/docs/components-structure-app-provider) but can be used independently to apply a base color scheme to its children. - - - - - - - - 1 × Oasis Glass, 4-Pack - 1 × Anubis Cup, 2-Pack - - - - - - - - 1 × Oasis Glass, 4-Pack - 1 × Anubis Cup, 2-Pack - - - - - - - `, - }, - }, - }} - > - {Template.bind({})} - - - - - diff --git a/src/components/CustomProperties/index.ts b/src/components/CustomProperties/index.ts deleted file mode 100644 index 964ea421..00000000 --- a/src/components/CustomProperties/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as CustomProperties } from './CustomProperties.vue'; diff --git a/src/components/CustomProperties/utils.ts b/src/components/CustomProperties/utils.ts deleted file mode 100644 index de355e21..00000000 --- a/src/components/CustomProperties/utils.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ColorScheme } from '@shopify/polaris-tokens'; - -export const DEFAULT_COLOR_SCHEME: ColorScheme = 'light'; - -export interface CustomPropertiesProps { - /** Determines what color scheme is applied to child content. */ - colorScheme?: ColorScheme; - /** Element used for the root node. */ - as?: string; -} diff --git a/src/components/FormLayout/components/Item/Item.vue b/src/components/FormLayout/components/Item/Item.vue index 8d8c759a..1a104bd2 100644 --- a/src/components/FormLayout/components/Item/Item.vue +++ b/src/components/FormLayout/components/Item/Item.vue @@ -1,5 +1,5 @@ diff --git a/src/components/Frame/Frame.vue b/src/components/Frame/Frame.vue index 4acb7109..47eb91dd 100644 --- a/src/components/Frame/Frame.vue +++ b/src/components/Frame/Frame.vue @@ -107,7 +107,7 @@ import { computed, onMounted, provide, ref, useSlots, watch } from 'vue'; import { classNames } from 'polaris/polaris-react/src/utilities/css'; import { dataPolarisTopBar, layer } from 'polaris/polaris-react/src/components/shared'; import { setRootProperty } from 'polaris/polaris-react/src/utilities/set-root-property'; -import { tokens } from '@shopify/polaris-tokens'; +import { motion } from '@shopify/polaris-tokens'; import { UseI18n } from '@/use'; import styles from '@/classes/Frame.json'; import MobileCancelMajor from '@icons/MobileCancelMajor.svg'; @@ -149,8 +149,8 @@ const APP_FRAME_NAV = 'AppFrameNav'; const APP_FRAME_TOP_BAR = 'AppFrameTopBar'; const APP_FRAME_LOADING_BAR = 'AppFrameLoadingBar'; -const CONTEXTUALSAVEBAR_FADE_DURATION = parseInt(tokens.motion['duration-400'].value, 10); -const NAVIGATION_ANIMATION_DURATION = parseInt(tokens.motion['duration-300'].value, 10); +const CONTEXTUALSAVEBAR_FADE_DURATION = parseInt(motion['duration-400'], 10); +const NAVIGATION_ANIMATION_DURATION = parseInt(motion['duration-300'], 10); const props = defineProps(); diff --git a/src/components/Frame/README.stories.mdx b/src/components/Frame/README.stories.mdx index 7df0e20c..5c25736d 100644 --- a/src/components/Frame/README.stories.mdx +++ b/src/components/Frame/README.stories.mdx @@ -77,10 +77,6 @@ export const Template = (args) => ({ isLoading: false, isDirty: false, toastActive: false, - userMenuAction: [ - { items: [{ content: 'Back to Shopify', icon: ArrowLeftMinor }] }, - { items: [{ content: 'Community forums' }] }, - ], userMenuMessage: { title: 'Another Message', description:'This is a description of message', @@ -129,10 +125,14 @@ export const Template = (args) => ({ topBarSource: 'https://github.com/ownego/polaris-vue/raw/dev/public/images/logo.png', contextualSaveBarSource: 'https://github.com/ownego/polaris-vue/raw/dev/public/images/logo.png', } + const userMenuAction = [ + { items: [{ content: 'Back to Shopify', icon: ArrowLeftMinor }] }, + { items: [{ content: 'Community forums' }] }, + ]; const navItems = [ { label: 'Back to Shopify', icon: ArrowLeftMinor }, ]; - return { logo, navItems, QuestionMarkMajor, CirclePlusOutlineMinor }; + return { userMenuAction, logo, navItems, QuestionMarkMajor, CirclePlusOutlineMinor }; }, template: ` -CustomProperties(color-scheme="dark") - div(:class="styles.ContextualSaveBar") - div( - v-if="slots.contextControl", - :class="styles.ContextControl", +div(:class="styles.ContextualSaveBar") + div( + v-if="slots.contextControl", + :class="styles.ContextControl", + ) + slot(name="contextControl") + div( + v-if="!alignContentFlush && !slots.contextControl", + :class="styles.LogoContainer", + :style="width", + ) + Image( + v-if="logo", + :style="{ width }", + :source="logo.contextualSaveBarSource || ''", + alt="", ) - slot(name="contextControl") - div( - v-if="!alignContentFlush && !slots.contextControl", - :class="styles.LogoContainer", - :style="width", - ) - Image( - v-if="logo", - :style="{ width }", - :source="logo.contextualSaveBarSource || ''", - alt="", + div(:class="contentsClassName") + h2(:class="styles.Message") {{ message }} + div(:class="styles.ActionContainer") + Stack( + spacing="tight", + :wrap="false", ) - div(:class="contentsClassName") - h2(:class="styles.Message") {{ message }} - div(:class="styles.ActionContainer") - Stack( - spacing="tight", - :wrap="false", + slot(name="secondaryMenu") + span   + Button( + v-if="discardAction", + :url="discardAction.url", + :loading="discardAction.loading", + :disabled="discardAction.disabled", + :accessibilityLabel="discardAction.content", + @click="discardActionHandler", + ) + template(v-if="discardAction.content") {{ discardAction.content }} + template(v-else) {{ discardLang }} + Button( + v-if="saveAction", + primary, + :url="saveAction.url", + :loading="saveAction.loading", + :disabled="saveAction.disabled", + :accessibilityLabel="saveAction.content", + @click="handleSaveAction", ) - slot(name="secondaryMenu") - span   - Button( - v-if="discardAction", - :url="discardAction.url", - :loading="discardAction.loading", - :disabled="discardAction.disabled", - :accessibilityLabel="discardAction.content", - @click="discardActionHandler", - ) - template(v-if="discardAction.content") {{ discardAction.content }} - template(v-else) {{ discardLang }} - Button( - v-if="saveAction", - primary, - :url="saveAction.url", - :loading="saveAction.loading", - :disabled="saveAction.disabled", - :accessibilityLabel="saveAction.content", - @click="saveAction.onAction", - ) - template(v-if="saveAction.content") {{ saveAction.content }} - template(v-else) {{ saveLang }} + template(v-if="saveAction.content") {{ saveAction.content }} + template(v-else) {{ saveLang }} DiscardConfirmationModal( v-if="discardAction && discardAction.onAction && discardAction.discardConfirmationModal", :open="discardConfirmationModalVisible", @@ -59,7 +58,7 @@ DiscardConfirmationModal( import { computed, ref, useSlots } from 'vue'; import { classNames } from 'polaris/polaris-react/src/utilities/css'; import { getWidth } from 'polaris/polaris-react/src/utilities/get-width'; -import { CustomProperties, Stack, Image, Button } from '@/components'; +import { Stack, Image, Button } from '@/components'; import styles from '@/classes/Frame-ContextualSaveBar.json'; import type { ContextualSaveBarAction, ContextualSaveBarCombinedActionProps } from '@/utilities/frame/types'; import { UseFrame } from '@/utilities/frame'; @@ -103,6 +102,10 @@ const width = getWidth(logo, 104); const discardConfirmationModalVisible = ref(false); +const handleSaveAction = (e: Event) => { + props.saveAction?.onAction && props.saveAction.onAction(); +}; + const toggleDiscardConfirmationModal = () => { discardConfirmationModalVisible.value = !discardConfirmationModalVisible.value; }; diff --git a/src/components/Frame/components/Toast/Toast.vue b/src/components/Frame/components/Toast/Toast.vue index 2451d45a..14430dca 100644 --- a/src/components/Frame/components/Toast/Toast.vue +++ b/src/components/Frame/components/Toast/Toast.vue @@ -1,35 +1,34 @@ diff --git a/src/components/InlineCode/index.ts b/src/components/InlineCode/index.ts new file mode 100644 index 00000000..b5a36175 --- /dev/null +++ b/src/components/InlineCode/index.ts @@ -0,0 +1 @@ +export { default as InlineCode } from './InlineCode.vue'; diff --git a/src/components/Layout/README.stories.mdx b/src/components/Layout/README.stories.mdx index 193703e0..e0a82b7d 100644 --- a/src/components/Layout/README.stories.mdx +++ b/src/components/Layout/README.stories.mdx @@ -70,7 +70,7 @@ export const OneColLayout = (args) => ({ template: ` - + @@ -87,7 +87,7 @@ export const OneColLayout = (args) => ({ code: dedent` - + @@ -112,12 +112,12 @@ export const TwoColLayoutDW = (args) => ({ template: ` - + - - + + @@ -135,12 +135,12 @@ export const TwoColLayoutDW = (args) => ({ code: dedent` - + - - + + @@ -164,13 +164,13 @@ export const TwoColLayoutSW = (args) => ({ components: { Layout, LayoutSection, AnnotatedSection, TextField }, template: ` - - + + - - + + @@ -187,13 +187,13 @@ export const TwoColLayoutSW = (args) => ({ state: 'close', code: dedent` - - + + - - + + @@ -217,18 +217,18 @@ export const ThreeColLayoutSW = (args) => ({ components: { Layout, LayoutSection, AnnotatedSection, TextField }, template: ` - - + + - - + + - - + + @@ -245,18 +245,18 @@ export const ThreeColLayoutSW = (args) => ({ state: 'close', code: dedent` - - + + - - + + - - + + @@ -414,7 +414,7 @@ export const Example = (args) => ({ template: ` - + @@ -432,7 +432,7 @@ export const Example = (args) => ({ code: dedent` - + diff --git a/src/components/Listbox/components/Option/Option.vue b/src/components/Listbox/components/Option/Option.vue index 1f45ea78..3613b904 100644 --- a/src/components/Listbox/components/Option/Option.vue +++ b/src/components/Listbox/components/Option/Option.vue @@ -112,6 +112,7 @@ const className = computed(() => classNames( const handleOptionSelect = (event: MouseEvent | KeyboardEvent): void => { event.preventDefault(); + event.stopPropagation(); onAction && onAction(); if (listItemRef.value && !onAction) { diff --git a/src/components/Modal/README.stories.mdx b/src/components/Modal/README.stories.mdx index f0f79543..38bc7cd9 100644 --- a/src/components/Modal/README.stories.mdx +++ b/src/components/Modal/README.stories.mdx @@ -14,11 +14,6 @@ import { title="Components / Overlays / Modal" component={Modal} argTypes={{ - colorScheme: { - table: { - disable: true, - }, - }, close: { description: "Callback when modal is closed", control: { disable: true }, @@ -363,9 +358,6 @@ Modals are overlays that require merchants to take an action before they can con name="Modal" inline={false} height="500px" - args={{ - colorScheme: "light", - }} parameters={{ docs: { source: { diff --git a/src/components/Popover/Popover.vue b/src/components/Popover/Popover.vue index cefbd17f..9f06214d 100644 --- a/src/components/Popover/Popover.vue +++ b/src/components/Popover/Popover.vue @@ -18,7 +18,6 @@ component( :zIndexOverride="zIndexOverride", :autofocusTarget="autofocusTarget", :sectioned="sectioned", - :colorScheme="colorScheme", @close="handleClose", @scrolled-to-bottom="emit('scrolled-to-bottom')", ) @@ -80,8 +79,6 @@ interface PopoverProps { ariaHaspopup?: string; /** Allow the popover overlay to be hidden when printing */ hideOnPrint?: boolean; - /** Accepts a color scheme for the contents of the popover */ - colorScheme?: PopoverOverlayProps['colorScheme']; /** * The preferred auto focus target defaulting to the popover container * @default 'container' @@ -94,7 +91,6 @@ const props = withDefaults(defineProps(), { preferredAlignment: undefined, zIndexOverride: undefined, ariaHaspopup: undefined, - colorScheme: undefined, activatorWrapper: 'div', preferInputActivator: true, autofocusTarget: 'container', diff --git a/src/components/Popover/README.stories.mdx b/src/components/Popover/README.stories.mdx index fcafdb41..bef21cbd 100644 --- a/src/components/Popover/README.stories.mdx +++ b/src/components/Popover/README.stories.mdx @@ -59,18 +59,6 @@ import { }, }, }, - colorScheme: { - options: ["light", "dark"], - control: { type: "select" }, - table: { - defaultValue: { - summary: "light", - }, - type: { - summary: "dark | light", - }, - }, - }, close: { name: "close", description: "Callback when popover is closed", @@ -149,7 +137,6 @@ export const Template = (args, { argTypes }) => ({ :active="active" autofocusTarget="first-node" @close="toggleActive" - :colorScheme="'${args.colorScheme}'" > diff --git a/src/components/Text/index.ts b/src/components/Text/index.ts new file mode 100644 index 00000000..f6db9bf1 --- /dev/null +++ b/src/components/Text/index.ts @@ -0,0 +1 @@ +export { default as Text } from './Text.vue'; diff --git a/src/components/TextField/TextField.vue b/src/components/TextField/TextField.vue index fd6a42f3..201736f8 100644 --- a/src/components/TextField/TextField.vue +++ b/src/components/TextField/TextField.vue @@ -330,11 +330,12 @@ const spinnerRef = ref | null>(null); watch( () => props.focused, () => { - if (!inputRef.value || props.focused === undefined) { + const input = props.multiline ? textAreaRef.value : inputRef.value; + if (!input || props.focused === undefined) { return; } - props.focused ? inputRef.value.focus() : inputRef.value.blur(); + props.focused ? input.focus() : input.blur(); }, ); diff --git a/src/components/TopBar/README.stories.mdx b/src/components/TopBar/README.stories.mdx index 9e3bda53..1d471dea 100644 --- a/src/components/TopBar/README.stories.mdx +++ b/src/components/TopBar/README.stories.mdx @@ -96,7 +96,7 @@ import QuestionMarkMajor from '@icons/QuestionMarkMajor.svg'; /> export const Template = (args) => ({ - components: { Frame, TopBar, TopBarUserMenu, TopBarMenu, Icon, VisuallyHidden, TopBarSearchField, ActionList }, + components: { ArrowLeftMinor, Frame, TopBar, TopBarUserMenu, TopBarMenu, Icon, VisuallyHidden, TopBarSearchField, ActionList }, setup() { const logo = { width: 30, @@ -120,10 +120,10 @@ export const Template = (args) => ({ const toggleIsSecondaryMenuOpen = () => { isSecondaryMenuOpen.value = !isSecondaryMenuOpen.value; }; - const userMenuAction = ref([ + const userMenuAction = [ { items: [{ content: 'Back to Shopify', icon: ArrowLeftMinor }] }, - { items: [{ content: 'Community forums' }] }] - ); + { items: [{ content: 'Community forums' }]}, + ]; const clickHandle = () => { alert('clicked'); }; const userMenuMessage = ref({ title: 'Another Message', diff --git a/src/components/TopBar/components/Menu/Menu.vue b/src/components/TopBar/components/Menu/Menu.vue index 8d217b01..80b16531 100644 --- a/src/components/TopBar/components/Menu/Menu.vue +++ b/src/components/TopBar/components/Menu/Menu.vue @@ -3,8 +3,7 @@ Popover( fixed, :active="open", :full-height="isFullHeight", - preferredAlignment="right", - :color-scheme="colorScheme", + preferred-alignment="right", @close="$emit('close')", ) template(#activator) @@ -41,7 +40,6 @@ export default { import { computed } from 'vue'; import styles from '@/classes/TopBar-Menu.json'; import type { ActionListProps } from '@/components/ActionList/utils'; -import type { PopoverProps } from '@/components/Popover/utils'; import type { MessageProps } from './components/Message/utils'; import { Popover, ActionList } from '@/components'; import { Message } from './components'; @@ -53,8 +51,6 @@ interface MenuProps { message?: MessageProps; /** A boolean property indicating whether the menu is currently open */ open: boolean; - /** Accepts a color scheme for the contents of the menu */ - colorScheme?: PopoverProps['colorScheme']; /** A string that provides the accessibility labeling */ accessibilityLabel?: string; } diff --git a/src/components/TopBar/components/Menu/utils.ts b/src/components/TopBar/components/Menu/utils.ts index ceadfc82..c7756ee7 100644 --- a/src/components/TopBar/components/Menu/utils.ts +++ b/src/components/TopBar/components/Menu/utils.ts @@ -1,5 +1,4 @@ import type { ActionListProps } from '@/components/ActionList/utils'; -import type { PopoverProps } from '@/components/Popover/utils'; import type { MessageProps } from './components/Message/utils'; export interface MenuProps { @@ -9,8 +8,6 @@ export interface MenuProps { message?: MessageProps; /** A boolean property indicating whether the menu is currently open */ open: boolean; - /** Accepts a color scheme for the contents of the menu */ - colorScheme?: PopoverProps['colorScheme']; /** A string that provides the accessibility labeling */ accessibilityLabel?: string; } diff --git a/src/components/TopBar/components/Search/Search.vue b/src/components/TopBar/components/Search/Search.vue index 7641de8e..dbedc4ca 100644 --- a/src/components/TopBar/components/Search/Search.vue +++ b/src/components/TopBar/components/Search/Search.vue @@ -8,18 +8,15 @@ div( v-if="slots.default", :class="className", ) - //- TODO: Fix this - add `color-scheme="dark"` to CustomProperties component - CustomProperties() - div(:class="styles.SearchContent") - div(:class="styles.Results") - slot + div(:class="styles.SearchContent") + div(:class="styles.Results") + slot