Skip to content

Commit

Permalink
fix: use css packages instead of component-classes (#55)
Browse files Browse the repository at this point in the history
* fix: use css packages instead of component-classes

* fix: bump css to 1.0.0-alpha.33 and @warp-ds/uno to 1.0.0-alpha.60

* docs: bump pkg version in eik url

* test: set link tags in storybook's preview-head

---------

Co-authored-by: BalbinaK <balbuhhha@gmail.com>
  • Loading branch information
AnnaRybkina and BalbinaK authored Jul 14, 2023
1 parent 6ee34ac commit 64d45d3
Show file tree
Hide file tree
Showing 32 changed files with 159 additions and 86 deletions.
1 change: 0 additions & 1 deletion .storybook/preview-body.html

This file was deleted.

2 changes: 2 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<link rel="stylesheet" href="https://assets.finn.no/pkg/@warp-ds/css/1.0.0-alpha.33/tokens/finn-no.css" />
<link rel="stylesheet" href="https://assets.finn.no/pkg/@warp-ds/css/1.0.0-alpha.33/resets.min.css" />
1 change: 0 additions & 1 deletion @types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ declare module '*.module.css' {
}

declare module '@fabric-ds/css';
declare module '@warp-ds/component-classes';
declare module '@fabric-ds/css/tailwind-css';
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
href="https://www.finn.no/favicon.ico"
type="image/x-icon"
/>
<link rel="stylesheet" href="https://assets.finn.no/pkg/@warp-ds/tokens/v1/finn-no.css" />
<link rel="stylesheet" href="https://assets.finn.no/pkg/@warp-ds/css/1.0.0-alpha.33/tokens/finn-no.css" />
<link rel="stylesheet" href="https://assets.finn.no/pkg/@warp-ds/css/1.0.0-alpha.33/resets.min.css" />
</head>
<body>
<div class="m-16">
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@
},
"dependencies": {
"@chbphone55/classnames": "^2.0.0",
"@warp-ds/uno": "^1.0.0-alpha.49",
"@warp-ds/component-classes": "^1.0.0-alpha.116",
"@warp-ds/css": "^1.0.0-alpha.33",
"@warp-ds/core": "^1.0.0",
"@warp-ds/uno": "^1.0.0-alpha.60",
"react-focus-lock": "^2.5.2",
"resize-observer-polyfill": "^1.5.1",
"scroll-doctor": "^1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/_helpers/affix.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { suffix, prefix } from '@warp-ds/component-classes';
import { suffix, prefix } from '@warp-ds/css/component-classes';
import { classNames } from '@chbphone55/classnames';

interface AffixProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/_helpers/clickable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { classNames } from '@chbphone55/classnames';
import { clickable as ccClickable } from '@warp-ds/component-classes';
import { clickable as ccClickable } from '@warp-ds/css/component-classes';
import { Item as ToggleItem } from '../toggle/src/item';
import { useId } from '../utils/src/useId';

Expand Down
2 changes: 1 addition & 1 deletion packages/_helpers/dead-toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { classNames } from '@chbphone55/classnames';
import { toggle as ccToggle } from '@warp-ds/component-classes';
import { toggle as ccToggle } from '@warp-ds/css/component-classes';
import { Item } from '../toggle/src/item';

export interface DeadToggleProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/alert/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { classNames } from '@chbphone55/classnames';
import React, { PropsWithChildren, ReactElement } from 'react';
import { alert as ccAlert } from '@warp-ds/component-classes';
import { alert as ccAlert } from '@warp-ds/css/component-classes';
import { AlertProps } from '.';
import { ExpandTransition } from '../../_helpers';

Expand Down
2 changes: 1 addition & 1 deletion packages/attention/src/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useRecompute as recompute,
arrowLabels,
} from '@warp-ds/core/attention';
import { attention as ccAttention } from '@warp-ds/component-classes';
import { attention as ccAttention } from '@warp-ds/css/component-classes';
import { ArrowProps, AttentionProps } from './props';

export function Attention(props: AttentionProps) {
Expand Down
2 changes: 1 addition & 1 deletion packages/box/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { classNames } from '@chbphone55/classnames';
import { box as ccBox } from '@warp-ds/component-classes';
import { box as ccBox } from '@warp-ds/css/component-classes';
import React from 'react';
import { BoxProps } from './props';

Expand Down
2 changes: 1 addition & 1 deletion packages/breadcrumbs/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import type { BreadcrumbsProps } from './props';
import { interleave } from '@warp-ds/core/breadcrumbs';
import { breadcrumbs as ccBreadcrumbs } from "@warp-ds/component-classes";
import { breadcrumbs as ccBreadcrumbs } from "@warp-ds/css/component-classes";

export const Breadcrumbs = (props: BreadcrumbsProps) => {
const { children, className, ...rest } = props;
Expand Down
2 changes: 1 addition & 1 deletion packages/button/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { forwardRef, Ref } from 'react';
import { button as ccButton } from '@warp-ds/component-classes';
import { button as ccButton } from '@warp-ds/css/component-classes';
import { classNames } from '@chbphone55/classnames';
import type { ButtonProps } from './props';

Expand Down
2 changes: 1 addition & 1 deletion packages/card/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { card as ccCard } from '@warp-ds/component-classes';
import { card as ccCard } from '@warp-ds/css/component-classes';
import { classNames } from '@chbphone55/classnames';
import { CardProps } from './props';
import { useLogDeprecationWarning } from '../../utils/src';
Expand Down
2 changes: 1 addition & 1 deletion packages/combobox/src/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, {
useRef,
useState,
} from 'react';
import { combobox as ccCombobox } from '@warp-ds/component-classes';
import { combobox as ccCombobox } from '@warp-ds/css/component-classes';
import { TextField } from '../../textfield/src';
import { useId } from '../../utils/src';
import { ComboboxProps, OptionWithIdAndMatch } from './props';
Expand Down
2 changes: 1 addition & 1 deletion packages/expandable/src/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { classNames } from '@chbphone55/classnames';
import {
box as ccBox,
expandable as ccExpandable,
} from '@warp-ds/component-classes';
} from '@warp-ds/css/component-classes';
import React from 'react';
import { ExpandTransition, UnstyledHeading } from '../../_helpers';
import { ExpandableProps } from './props';
Expand Down
2 changes: 1 addition & 1 deletion packages/modal/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { classNames } from '@chbphone55/classnames';
import { modal as ccModal } from '@warp-ds/component-classes';
import { modal as ccModal } from '@warp-ds/css/component-classes';
import React, { useEffect, useRef } from 'react';
import { useId } from '../../utils/src';
import FocusLock from 'react-focus-lock';
Expand Down
2 changes: 1 addition & 1 deletion packages/pill/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { classNames } from '@chbphone55/classnames';
import { PillProps } from '.';
import { pill as ccPill } from '@warp-ds/component-classes';
import { pill as ccPill } from '@warp-ds/css/component-classes';

export function Pill(props: PillProps) {
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/select/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { select as ccSelect, label as ccLabel, helpText as ccHelpText } from '@warp-ds/component-classes';
import { select as ccSelect, label as ccLabel, helpText as ccHelpText } from '@warp-ds/css/component-classes';
import { useId } from '../../utils/src';
import { classNames } from '@chbphone55/classnames';
import type { SelectProps } from './props';
Expand Down
2 changes: 1 addition & 1 deletion packages/slider/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { classNames } from '@chbphone55/classnames';
import { createHandlers, useDimensions } from '@warp-ds/core/slider';
import { slider as ccSlider } from '@warp-ds/component-classes';
import { slider as ccSlider } from '@warp-ds/css/component-classes';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { SliderProps } from './props';

Expand Down
2 changes: 1 addition & 1 deletion packages/steps/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { createContext } from 'react';
import { StepsProps } from './props';
import { classNames } from '@chbphone55/classnames';
import { steps as ccSteps } from '@warp-ds/component-classes';
import { steps as ccSteps } from '@warp-ds/css/component-classes';


export const StepsContext = createContext<{
Expand Down
2 changes: 1 addition & 1 deletion packages/steps/src/step.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { classNames } from '@chbphone55/classnames';
import { step as ccStep } from '@warp-ds/component-classes';
import { step as ccStep } from '@warp-ds/css/component-classes';
import { useContext } from 'react';
import { StepsContext } from './component';

Expand Down
2 changes: 1 addition & 1 deletion packages/switch/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { SwitchProps } from './props';
import { classNames } from '@chbphone55/classnames';
import { switchToggle as ccSwitch } from '@warp-ds/component-classes';
import { switchToggle as ccSwitch } from '@warp-ds/css/component-classes';

export function Switch({
id,
Expand Down
2 changes: 1 addition & 1 deletion packages/tabs/src/component-tab-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { tab as ccTab } from '@warp-ds/component-classes';
import { tab as ccTab } from '@warp-ds/css/component-classes';
import type { TabPanelProps } from './props';

export function TabPanel(props: TabPanelProps) {
Expand Down
7 changes: 4 additions & 3 deletions packages/tabs/src/component-tab.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from 'react';
import { classNames } from '@chbphone55/classnames';
import { tab as ccTab } from '@warp-ds/component-classes';
import { tab as ccTab } from '@warp-ds/css/component-classes';
import type { TabProps } from './props';

const setup = ({ className, isActive, setActive, ...rest }: any) => ({
tab: classNames(ccTab.tab, {
[className]: !!className,
[ccTab.tabActive]: isActive,
}),
icon: classNames(ccTab.icon, ccTab.iconUnderlined, isActive ? ccTab.iconUnderlinedActive : ccTab.iconUnderlinedInactive),
icon: classNames(ccTab.icon, {
[ccTab.iconUnderlinedActive] : isActive,
}),
content: classNames(ccTab.contentUnderlined, {
[ccTab.contentUnderlinedActive]: isActive,
[ccTab.contentUnderlinedInactive]: !isActive,
}),
attrs: { ...rest },
});
Expand Down
2 changes: 1 addition & 1 deletion packages/tabs/src/component-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, {
Children,
} from 'react';
import { classNames } from '@chbphone55/classnames';
import { gridLayout, tabs as ccTabs } from '@warp-ds/component-classes';
import { gridLayout, tabs as ccTabs } from '@warp-ds/css/component-classes';
import { debounce } from './utils';
import type { TabsProps } from './props';

Expand Down
2 changes: 1 addition & 1 deletion packages/textarea/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { forwardRef, useRef } from 'react';
import { classNames } from '@chbphone55/classnames';
import { input as ccInput, label as ccLabel, helpText as ccHelpText } from '@warp-ds/component-classes';
import { input as ccInput, label as ccLabel, helpText as ccHelpText } from '@warp-ds/css/component-classes';
import { useId } from '../../utils/src';
import { TextAreaProps } from './props';
import useTextAreaHeight from './useTextAreaHeight';
Expand Down
2 changes: 1 addition & 1 deletion packages/textfield/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { forwardRef } from 'react';
import { classNames } from '@chbphone55/classnames';
import { input as ccInput, label as ccLabel, helpText as ccHelpText } from '@warp-ds/component-classes';
import { input as ccInput, label as ccLabel, helpText as ccHelpText } from '@warp-ds/css/component-classes';
import { useId } from '../../utils/src';
import { TextFieldProps } from './props';

Expand Down
4 changes: 2 additions & 2 deletions packages/toggle/src/component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { label as ccLabel, helpText as ccHelpText, toggle as ccToggle } from '@warp-ds/component-classes';
import { label as ccLabel, helpText as ccHelpText, toggle as ccToggle } from '@warp-ds/css/component-classes';
import { useId } from '../../utils/src';
import { ToggleEntry, ToggleProps } from './props';
import { classNames } from '@chbphone55/classnames';
Expand Down Expand Up @@ -50,10 +50,10 @@ export function Toggle(props: ToggleProps) {
props.selected !== undefined || props.checked !== undefined;

const labelClasses = classNames({
[ccToggle.indeterminate]: props.indeterminate,
[ccToggle.label]: !isRadioButton,
[ccToggle.focusable]: !isRadioButton,
[ccToggle.noContent]: !props.indeterminate,
[ccToggle.indeterminate]: props.indeterminate,
[`${ccToggle.radio} ${ccToggle.labelRadioBorder} ${ccToggle.radioChecked}`]: isRadio,
[ccToggle.radioInvalid]: isRadio && isInvalid,
[`${ccToggle.checkbox} ${ccToggle.labelCheckboxBorder} ${ccToggle.checkboxChecked}`]: isCheckbox,
Expand Down
2 changes: 1 addition & 1 deletion packages/toggle/src/item.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { toggle as ccToggle } from '@warp-ds/component-classes';
import { toggle as ccToggle } from '@warp-ds/css/component-classes';
import { useId } from '../../utils/src';
import { ToggleEntry } from './props';

Expand Down
Loading

0 comments on commit 64d45d3

Please sign in to comment.