diff --git a/packages/calendar/src/components/input-types/date-range-input/DateRangeInput.tsx b/packages/calendar/src/components/input-types/date-range-input/DateRangeInput.tsx index 803f4535c..fe826d65b 100644 --- a/packages/calendar/src/components/input-types/date-range-input/DateRangeInput.tsx +++ b/packages/calendar/src/components/input-types/date-range-input/DateRangeInput.tsx @@ -12,8 +12,11 @@ import { defaultCalendarTheme, } from "../../calendar/CalendarTheme"; import { useDateRangeInput } from "./hooks/UseDateRangeInput"; -import { Icon, stenaCalendar } from "@stenajs-webui/elements"; -import { faLongArrowAltRight } from "@fortawesome/free-solid-svg-icons/faLongArrowAltRight"; +import { + Icon, + stenaArrowWideRight, + stenaCalendar, +} from "@stenajs-webui/elements"; import { CalendarWithMonthSwitcher } from "../../../features/month-switcher/CalendarWithMonthSwitcher"; import { CalendarPanelType } from "../../../features/calendar-with-month-year-pickers/CalendarPanelType"; import { Popover } from "@stenajs-webui/tooltip"; @@ -154,7 +157,7 @@ export function DateRangeInput({ /> diff --git a/packages/calendar/src/features/month-picker/MonthPicker.tsx b/packages/calendar/src/features/month-picker/MonthPicker.tsx index 8f515e269..c906253b1 100644 --- a/packages/calendar/src/features/month-picker/MonthPicker.tsx +++ b/packages/calendar/src/features/month-picker/MonthPicker.tsx @@ -22,9 +22,9 @@ export const MonthPicker: React.FC = ({ locale = enGB, }) => { return ( - + {monthMatrix.map((monthRow) => ( - + {monthRow.map((month) => ( = ({ }, [locale, month]); return ( - + {value === month ? ( ({ {!hideYearPagination && ( )} - + } headerRightContent={ - + {!hideYearPagination && ( diff --git a/packages/calendar/src/features/month-switcher/MonthSwitcherBelow.tsx b/packages/calendar/src/features/month-switcher/MonthSwitcherBelow.tsx index a6bb630c3..6d3cbe069 100644 --- a/packages/calendar/src/features/month-switcher/MonthSwitcherBelow.tsx +++ b/packages/calendar/src/features/month-switcher/MonthSwitcherBelow.tsx @@ -2,13 +2,13 @@ import { Indent, Row, Space } from "@stenajs-webui/core"; import { FlatButton, stenaAngleLeft, + stenaAngleLeftDouble, stenaAngleRight, + stenaAngleRightDouble, } from "@stenajs-webui/elements"; import * as React from "react"; -import { CalendarTheme } from "../../components/calendar/CalendarTheme"; -import { faAngleDoubleLeft } from "@fortawesome/free-solid-svg-icons/faAngleDoubleLeft"; -import { faAngleDoubleRight } from "@fortawesome/free-solid-svg-icons/faAngleDoubleRight"; import { ReactNode } from "react"; +import { CalendarTheme } from "../../components/calendar/CalendarTheme"; export interface WithMonthSwitcherBelowProps { theme: CalendarTheme; @@ -30,13 +30,13 @@ export const WithMonthSwitcherBelow: React.FC = ({ {children} - + - + diff --git a/packages/calendar/src/features/year-picker/YearPicker.tsx b/packages/calendar/src/features/year-picker/YearPicker.tsx index ab1ec5700..86f95c261 100644 --- a/packages/calendar/src/features/year-picker/YearPicker.tsx +++ b/packages/calendar/src/features/year-picker/YearPicker.tsx @@ -3,9 +3,11 @@ import { useEffect, useMemo, useState } from "react"; import { ValueAndOnValueChangeProps } from "@stenajs-webui/forms"; import { Column, Row } from "@stenajs-webui/core"; import { YearPickerCell } from "./YearPickerCell"; -import { FlatButton } from "@stenajs-webui/elements"; -import { faCaretLeft } from "@fortawesome/free-solid-svg-icons/faCaretLeft"; -import { faCaretRight } from "@fortawesome/free-solid-svg-icons/faCaretRight"; +import { + FlatButton, + stenaArrowLeft, + stenaArrowRight, +} from "@stenajs-webui/elements"; import { chunk, range } from "lodash"; export interface YearPickerProps extends ValueAndOnValueChangeProps { @@ -37,13 +39,13 @@ export const YearPicker: React.FC = ({ setLastYear(lastYear - 3)} /> - + {yearRows.map((yearRow) => ( - + {yearRow.map((year) => ( = ({ setLastYear(lastYear + 3)} /> diff --git a/packages/calendar/src/features/year-picker/YearPickerCell.tsx b/packages/calendar/src/features/year-picker/YearPickerCell.tsx index 96993eded..0dcd3c2a6 100644 --- a/packages/calendar/src/features/year-picker/YearPickerCell.tsx +++ b/packages/calendar/src/features/year-picker/YearPickerCell.tsx @@ -14,7 +14,7 @@ export const YearPickerCell: React.FC = ({ }) => { const label = String(year); return ( - + {value === year ? ( onValueChange?.(year)} /> ) : ( diff --git a/packages/elements/src/components/ui/action-menu/ActionMenu.stories.tsx b/packages/elements/src/components/ui/action-menu/ActionMenu.stories.tsx index 7f3233b56..9ffdc5cce 100644 --- a/packages/elements/src/components/ui/action-menu/ActionMenu.stories.tsx +++ b/packages/elements/src/components/ui/action-menu/ActionMenu.stories.tsx @@ -1,4 +1,3 @@ -import { faSave } from "@fortawesome/free-solid-svg-icons/faSave"; import { useBoolean, useTimeoutState } from "@stenajs-webui/core"; import { action } from "@storybook/addon-actions"; import { ActionMenuItem } from "./ActionMenuItem"; @@ -144,7 +143,7 @@ export const Standard = () => ( ); export const Outlined = () => ( - + { }; return ( - + { /> { ? "Saving with danger..." : "Save dangerously" } - leftIcon={isDangerOn ? faSave : faSadCry} + leftIcon={isDangerOn ? stenaSave : faSadCry} onClick={startDanger} variant={"danger"} disabled={!isDangerOn} @@ -240,7 +239,7 @@ export const AsyncItem = () => { ? "Saving with success..." : "Save successfully" } - leftIcon={isSuccessOn ? faSave : faSadCry} + leftIcon={isSuccessOn ? stenaSave : faSadCry} onClick={startSuccess} disabled={!isSuccessOn} /> diff --git a/packages/elements/src/components/ui/bread-crumbs/BreadCrumbs.tsx b/packages/elements/src/components/ui/bread-crumbs/BreadCrumbs.tsx index d6bb452f1..6fd3fe31e 100644 --- a/packages/elements/src/components/ui/bread-crumbs/BreadCrumbs.tsx +++ b/packages/elements/src/components/ui/bread-crumbs/BreadCrumbs.tsx @@ -2,7 +2,7 @@ import { Indent, Row } from "@stenajs-webui/core"; import { cssColor } from "@stenajs-webui/theme"; import * as React from "react"; import { Children, ReactNode } from "react"; -import { stenaArrowRight } from "../../../icons/ui/IconsUi"; +import { stenaLineSlash } from "../../../icons/ui/IconsUi"; import { Icon } from "../icon/Icon"; export interface BreadCrumbsProps { @@ -19,7 +19,7 @@ export const BreadCrumbs: React.FC = ({ children }) => { {index > 0 && ( diff --git a/packages/elements/src/components/ui/bread-crumbs/Crumb.module.css b/packages/elements/src/components/ui/bread-crumbs/Crumb.module.css index 791404a25..444dd7a97 100644 --- a/packages/elements/src/components/ui/bread-crumbs/Crumb.module.css +++ b/packages/elements/src/components/ui/bread-crumbs/Crumb.module.css @@ -1,10 +1,10 @@ .crumb { - font-size: 1rem; + font-size: 1.2rem; font-family: var(--swui-font-primary); font-weight: var(--swui-font-weight-text-bold); letter-spacing: 0.1rem; text-decoration: none; - color: var(--swui-text-action-color); + color: var(--lhds-color-ui-500); &:not(:last-of-type) { cursor: pointer; diff --git a/packages/elements/src/components/ui/buttons/Button.module.css b/packages/elements/src/components/ui/buttons/Button.module.css index 8506c121e..a641af27e 100644 --- a/packages/elements/src/components/ui/buttons/Button.module.css +++ b/packages/elements/src/components/ui/buttons/Button.module.css @@ -6,8 +6,11 @@ --swui-button-text-color: var(--swui-white); --swui-button-text-decoration: none; --swui-button-letter-spacing: var(--swui-field-letter-spacing); - --swui-button-padding-vertical: calc(var(--swui-metrics-spacing) - 3px); - --swui-button-padding-horizontal: calc(var(--swui-metrics-spacing) * 3 - 1px); + --swui-button-padding-vertical: calc(var(--swui-metrics-spacing) - 1px); + --swui-button-padding-horizontal: calc(var(--swui-metrics-spacing) * 2 - 1px); + --swui-button-padding-horizontal-label-only: calc( + var(--swui-metrics-spacing) * 3 - 1px + ); /* Text */ --swui-button-text-color-focus: var(--swui-button-text-color); @@ -154,6 +157,11 @@ align-items: center; justify-content: center; + &.labelOnly { + padding: var(--swui-button-padding-vertical) + var(--swui-button-padding-horizontal-label-only); + } + &.iconButton { --current-icon-height: var(--swui-button-icon-height-medium-icon-only); @@ -193,6 +201,9 @@ --current-line-height: 1.6rem; --swui-button-padding-vertical: calc(var(--swui-metrics-space) / 2 - 1px); --swui-button-padding-horizontal: calc(var(--swui-metrics-space) - 1px); + --swui-button-padding-horizontal-label-only: calc( + var(--swui-metrics-space) * 2 - 1px + ); --current-text-size: 1.2rem; --current-icon-height: var(--swui-button-icon-height-small); @@ -203,8 +214,11 @@ &.large { --current-line-height: 2.4rem; - --swui-button-padding-vertical: calc(var(--swui-metrics-space) * 2 - 4px); + --swui-button-padding-vertical: calc(var(--swui-metrics-space) * 2 - 5px); --swui-button-padding-horizontal: calc(var(--swui-metrics-space) * 3 - 1px); + --swui-button-padding-horizontal-label-only: calc( + var(--swui-metrics-space) * 3 - 1px + ); --current-text-size: 1.8rem; --current-icon-height: var(--swui-button-icon-height-large); @@ -216,6 +230,9 @@ &.larger { --swui-button-padding-vertical: 24px; --swui-button-padding-horizontal: calc(var(--swui-metrics-space) * 6 - 1px); + --swui-button-padding-horizontal-label-only: calc( + var(--swui-metrics-space) * 6 - 1px + ); --current-text-size: 2rem; --current-line-height: 2.4rem; diff --git a/packages/elements/src/components/ui/buttons/PrimaryButton.tsx b/packages/elements/src/components/ui/buttons/PrimaryButton.tsx index 23b21159f..1bf96ace3 100644 --- a/packages/elements/src/components/ui/buttons/PrimaryButton.tsx +++ b/packages/elements/src/components/ui/buttons/PrimaryButton.tsx @@ -56,6 +56,8 @@ export const PrimaryButton = forwardRef( (loading && loadingLabel) ); + const labelOnly = hasLabel && !left && !leftIcon && !right && !rightIcon; + return ( + /> ); }; diff --git a/packages/panels/src/components/page-header/PageHeader.stories.tsx b/packages/panels/src/components/page-header/PageHeader.stories.tsx index e32d6a8fb..8b17a8291 100644 --- a/packages/panels/src/components/page-header/PageHeader.stories.tsx +++ b/packages/panels/src/components/page-header/PageHeader.stories.tsx @@ -8,6 +8,7 @@ import { PrimaryButton, SecondaryButton, stenaSliders, + stenaUser, Tab, TabMenu, Tag, @@ -19,6 +20,9 @@ import { TextInput } from "@stenajs-webui/forms"; import { NavBar } from "../nav-bar/NavBar"; import { cssColor } from "@stenajs-webui/theme"; import { PageHeaderRow } from "./PageHeaderRow"; +import { NavBarHeading } from "../nav-bar/NavBarHeading"; +import { NavBarButton } from "../nav-bar/NavBarButton"; +import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; export default { title: "panels/PageHeader", @@ -28,60 +32,77 @@ export default { component: PageHeader, }; -export const Demo = () => { +const Base: React.FC<{ icon?: IconDefinition }> = ({ icon }) => { const [tabId, setTabId] = useState(0); return ( - ( - - - - - - )} - renderPageHeading={() => ( - } - contentRight={ - <> - - - - - } - /> - )} - renderTabs={() => ( - - setTabId(0)} - /> - setTabId(1)} - /> - setTabId(2)} + <> + Stena line} + right={ + + + + + + } + /> + ( + + + + + + )} + renderPageHeading={() => ( + } + contentRight={ + <> + + + + + } /> - - )} - > - - - - - - - + )} + renderTabs={() => ( + + setTabId(0)} + /> + setTabId(1)} + /> + setTabId(2)} + /> + + )} + > + + + + + + + + ); }; +export const Demo = () => ; +export const NoIcon = () => ; + export const NoTabsOrHeadingContent = () => { return ( = ({ children, }) => { return ( - + - {renderBreadCrumbs && {renderBreadCrumbs()}} + {renderBreadCrumbs && ( + + + {renderBreadCrumbs()} + + )} {renderPageHeading?.()} {renderTabs?.()} diff --git a/packages/panels/src/components/page-header/PageHeading.tsx b/packages/panels/src/components/page-header/PageHeading.tsx index 54986f392..616ff9569 100644 --- a/packages/panels/src/components/page-header/PageHeading.tsx +++ b/packages/panels/src/components/page-header/PageHeading.tsx @@ -1,10 +1,13 @@ import * as React from "react"; import { ReactNode } from "react"; import { Heading, HeadingVariant, Row } from "@stenajs-webui/core"; +import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import { CircledIcon } from "@stenajs-webui/elements"; export type PageHeadingVariant = "compact" | "standard" | "relaxed"; interface PageHeadingProps { + icon?: IconDefinition; contentLeft?: ReactNode; contentRight?: ReactNode; heading: string; @@ -12,23 +15,26 @@ interface PageHeadingProps { variant?: PageHeadingVariant; } -const variantToSpacing: Record = { - compact: 1, - standard: 1.5, - relaxed: 2, -}; - export const PageHeading: React.FC = ({ + icon, heading, headingLevel = "h1", - variant = "standard", contentLeft, contentRight, }) => ( - - - {heading} - + + + + {icon && ( + <> + + + )} + + + {heading} + + {contentLeft} {contentRight} diff --git a/packages/panels/src/components/sidebar-menu/SidebarMenu.stories.tsx b/packages/panels/src/components/sidebar-menu/SidebarMenu.stories.tsx index a008a01ce..8a2bb1a39 100644 --- a/packages/panels/src/components/sidebar-menu/SidebarMenu.stories.tsx +++ b/packages/panels/src/components/sidebar-menu/SidebarMenu.stories.tsx @@ -1,12 +1,12 @@ import { Box, Column } from "@stenajs-webui/core"; import * as React from "react"; -import { faChartBar } from "@fortawesome/free-solid-svg-icons"; import { Icon, stenaBusinessClaim, stenaBusinessInvoice, stenaCalendar, stenaSailingTicket, + stenaStatisticsBar, stenaStatisticsLine, stenaStatusNoShow, } from "@stenajs-webui/elements"; @@ -66,10 +66,16 @@ export const Overview = () => { selected /> - + - + diff --git a/packages/theme/src/styles/default-theme.css b/packages/theme/src/styles/default-theme.css index b485d10cc..655fb0949 100644 --- a/packages/theme/src/styles/default-theme.css +++ b/packages/theme/src/styles/default-theme.css @@ -79,7 +79,7 @@ --swui-field-box-size-large: 32px; --swui-field-box-size-medium: 24px; --swui-field-box-size-small: 16px; - --swui-field-border-radius: 8px; + --swui-field-border-radius: 4px; --swui-field-icon-color: var(--swui-text-primary-color); --swui-field-icon-size: 13px; --swui-field-indicator-active-color: var(--swui-white);