Skip to content

Commit

Permalink
Merge pull request #201 from MrTRyy/199-buildin-normalradiobuttons
Browse files Browse the repository at this point in the history
199 buildin normalradiobuttons
  • Loading branch information
TobiTRy authored Nov 28, 2023
2 parents 0d05272 + f8f307b commit c466ad5
Show file tree
Hide file tree
Showing 267 changed files with 1,423 additions and 566 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ module.exports = {
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
},
ignorePatterns: ['vite.config.ts', '.eslintrc.cjs'],
};
9 changes: 8 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ jobs:
- name: Install Dependencies
run: npm install

- name: Ceck Prettier Formatting
- name: Check Prettier Formatting
run: npx prettier --check .

- name: Run ESLint
run: npm run lint

- name: Run Build
run: npm run build

- name: Fail if Previous Steps Failed
if: ${{ failure() }}
run: exit 1
3 changes: 3 additions & 0 deletions .github/workflows/qualityCheckForDevelop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ jobs:

- name: Run ESLint
run: npm run lint

- name: Run Build
run: npm run build
41 changes: 25 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@mrtryy/fancyuilibary",
"description": "FancyUI Libary",
"private": false,
"version": "0.1.12117",
"version": "0.1.129",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -15,28 +15,31 @@
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --fix --max-warnings=-1",
"checkFormat": "prettier --check .",
"format": "prettier --write .",
"predeploy": "npm run lint && npm run build && npm run checkFormat"
"predeploy": "npm run lint && npm run checkFormat && npm run build"
},
"lint-staged": {
"*.ts": [
"eslint --fix",
"eslint src --ext ts --report-unused-disable-directives --fix --max-warnings=-1",
"prettier --write"
],
"*.tsx": [
"eslint --fix",
"eslint src --ext tsx --report-unused-disable-directives --fix --max-warnings=-1",
"prettier --write"
],
"*.mdx": [
"prettier --write"
],
"*.yml": [
"prettier --write"
],
"*.json": [
"prettier --write"
]
},
"dependencies": {
"@react-spring/web": "^9.7.3",
"@types/color": "^3.0.3",
"@types/react-router-dom": "^5.3.3",
"@types/uuid": "^9.0.6",
"color": "^4.2.3",
"react-router-dom": "^6.14.1",
"uuid": "^9.0.1",
"vite-plugin-dts": "^3.1.1",
"zustand": "^4.3.9"
"vite-plugin-dts": "^3.1.1"
},
"devDependencies": {
"@storybook/addon-essentials": "^7.5.2",
Expand Down Expand Up @@ -73,18 +76,24 @@
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"styled-components": "^6.0.7"
"styled-components": "^6.0.7",
"zustand": "^4.3.9",
"color": "^4.2.3",
"uuid": "^9.0.1",
"@react-spring/web": "^9.7.3",
"@types/color": "^3.0.3",
"@types/uuid": "^9.0.6"
},
"files": [
"dist"
],
"main": "./dist/my-lib.umd.js",
"module": "./dist/my-lib.es.js",
"main": "./dist/fui.umd.js",
"module": "./dist/fui.es.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/my-lib.es.js",
"require": "./dist/my-lib.cjs.js",
"import": "./dist/fui.es.js",
"require": "./dist/fui.cjs.js",
"types": "./dist/index.d.ts"
},
"./package.json": "./package.json"
Expand Down
7 changes: 6 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ import ChipsRoute from './Routes/ChipsRoute/ChipsRoute';
import CheckboxRoute from './Routes/CheckboxRoute/CheckboxRoute';
import ColorGeneratorRoute from './Routes/ColorGeneratorRoute/ColorGeneratorRoute';
import { TTheme } from '@/Components/UI/Interface/TTheme';
import themeStore from './Components/UI/Design/color/themeStore';
import themeStore from './Components/UI/Design/color/themeStore/themeStore';
import GlobalStyle from './GlobalStyle';
import FancyContentRoute from './Routes/FancyContentRoute/FancyContentRoute';
import { FancyModal, FancySwipeUpModal } from './lib';
import SwitchesRoute from './Routes/Switches/SwitchesRoute';
import MenueRoute from './Routes/MenuRoute/MenueRoute';
import InfoCardRoute from './Routes/InfoCardRoute/InfoCardRoute';
import FancyLayoutRoute from './Routes/FancyLayoutRoute/FancyLayoutRoute';
import FancyBoxSetRoute from './Routes/FancyBoxSet/FancyBoxSetRoute';

// const Icon = (
// <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
Expand Down Expand Up @@ -179,6 +180,9 @@ function App() {
<li>
<Link to="/layout">Layout</Link>
</li>
<li>
<Link to="/fancyBoxSet">FancyBoxSet</Link>
</li>
<li>
<Link to="/experimental">Experimental</Link>
</li>
Expand Down Expand Up @@ -219,6 +223,7 @@ function App() {
<Route path="/menu" element={<MenueRoute />} />
<Route path="/infoCard" element={<InfoCardRoute />} />
<Route path="/layout" element={<FancyLayoutRoute />} />
<Route path="/fancyBoxSet" element={<FancyBoxSetRoute />} />
<Route path="/" element={<SwipeUpModal />} />
</Routes>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { TLayer } from '@/Components/UI/Interface/TLayer';
import { TTheme } from '@/Components/UI/Interface/TTheme';
import { TUiColors } from '@/Components/UI/Interface/TUiColors';
import { TThemeTypes } from '@/Components/UI/Interface/TUiColors';

export type TAlign = 'left' | 'center';

export interface IAlignedInputLabel {
$align?: TAlign;
$colorState?: 'error' | 'active' | 'default';
theme?: TTheme;
$themeType?: TUiColors;
$themeType?: TThemeTypes;
$layer?: TLayer;
}
9 changes: 5 additions & 4 deletions src/Components/UI/Atoms/AnimatedLabel/AnimatedInputLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { styled, css } from 'styled-components';

import InputLabel from '../InputLabel/InputLabel';
import { TUiColorsType } from '../../Design/color/designColor';
import { getTextColor } from '../../Design/color/colorCalculatorForComponet';
import InputLabel from '@/Components/UI/Atoms/InputLabel/InputLabel';
import { IAnimatedInputLabel } from './TAnimatedInputLabel.model';

import { getTextColor } from '@/Components/UI/Design/color/colorCalculatorForComponet';
import { TTheme } from '@/Components/UI/Interface/TTheme';

const activeHandler = (align: string, $moveUp?: boolean) => {
if (align !== 'center') {
return css`
Expand Down Expand Up @@ -34,7 +35,7 @@ const activeHandler = (align: string, $moveUp?: boolean) => {
// ---------- The input label wich hase some colors and an animation --------- //
// --------------------------------------------------------------------------- //
// eslint-disable-next-line react-refresh/only-export-components
export const AnimatedInputLabel = styled(InputLabel)<IAnimatedInputLabel & { theme?: TUiColorsType }>`
export const AnimatedInputLabel = styled(InputLabel)<IAnimatedInputLabel & { theme?: TTheme }>`
position: absolute;
padding: 12px 0 5px;
color: ${({ $colorState, theme, $themeType = 'secondary', $layer = 4 }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { TLayer } from '@/Components/UI/Interface/TLayer';
import { TTheme } from '@/Components/UI/Interface/TTheme';
import { TUiColors } from '@/Components/UI/Interface/TUiColors';
import { TThemeTypes } from '@/Components/UI/Interface/TUiColors';

export interface IAnimatedInputLabel {
$align?: 'center' | 'left';
$moveUp?: boolean;
$colorState?: 'error' | 'active' | 'default';
$themeType?: TUiColors;
$themeType?: TThemeTypes;
$layer?: TLayer;
theme?: TTheme;
}
6 changes: 3 additions & 3 deletions src/Components/UI/Atoms/ColorDisplay/ColorDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import Typography from '../Typography/Typography';
import copyToClipboard from '../../HelperFunctions/copyToClipBoard';
import CheckerBoardPattern from '../CheckerBoardPattern/CheckerBoardPattern';
import { ColorDisplayContainer, Wrapper, Content, WrapperSVG } from './ColorDisplay.style';
import ClipBoardIcon from '../../SVGIcons/SVGClipBoardIcon';
import ClipBoardIconCheck from '../../SVGIcons/SVGClipBoardIconChecked';
import themeStore from '../../Design/color/themeStore';
import ClipBoardIcon from '../../SVGIcons/SVGClipBoardIcon/SVGClipBoardIcon';
import ClipBoardIconCheck from '../../SVGIcons/SVGClipBoardIconChecked/SVGClipBoardIconChecked';
import themeStore from '../../Design/color/themeStore/themeStore';

// --------------------------------------------------------------------------- //
// ----- The main ColorDisplay Component for display the color in a box ------ //
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { styled, css } from 'styled-components';

import { boxShadow } from '../../Design/shadows';
import { boxShadow } from '../../Design/shadows/shadows';
import { TTheme } from '@/Components/UI/Interface/TTheme';

export const WrapperIndicator = styled.div<{ $isActive: boolean }>`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { css, styled } from 'styled-components';

import { IRange } from './DateNumberAtom';
import { disabledStyle } from '../../HelperFunctions/designFunctions/disableStyle';
import { TUiColors } from '@/Components/UI/Interface/TUiColors';
import { disabledStyle } from '../../Design/designFunctions/disabledStyle/disableStyle';
import { TThemeTypes } from '@/Components/UI/Interface/TUiColors';
import { TLayer } from '@/Components/UI/Interface/TLayer';
import { getTextColor } from '../../Design/color/colorCalculatorForComponet';
import { TTheme } from '@/Components/UI/Interface/TTheme';
Expand All @@ -14,7 +14,7 @@ interface IStyledDay {
$range?: IRange;
$isCurrentDay?: boolean;
$selected?: boolean;
$themeType?: TUiColors;
$themeType?: TThemeTypes;
$layer?: TLayer;
}
export const StyledDay = styled.button<IStyledDay & { theme: TTheme }>`
Expand Down
4 changes: 2 additions & 2 deletions src/Components/UI/Atoms/DateNumberAtom/DateNumberAtom.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { StyledDay } from './DateNumberAtom.style';
import Typography from '../Typography/Typography';
import { TUiColors } from '@/Components/UI/Interface/TUiColors';
import { TThemeTypes } from '@/Components/UI/Interface/TUiColors';
import { TLayer } from '@/Components/UI/Interface/TLayer';

export type IRange = { start?: boolean; end?: boolean; inRange?: boolean };
Expand All @@ -13,7 +13,7 @@ interface IDay {
onClick?: () => void;
range?: IRange;
isCurrentDay?: boolean;
themeType?: TUiColors;
themeType?: TThemeTypes;
layer?: TLayer;
}
// --------------------------------------------------------------------------- //
Expand Down
6 changes: 3 additions & 3 deletions src/Components/UI/Atoms/DateOutput/DateOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React, { useEffect, useMemo, useState } from 'react';
import { styled } from 'styled-components';

import Typography from '../Typography/Typography';
import { TUiColors } from '@/Components/UI/Interface/TUiColors';
import { TThemeTypes } from '@/Components/UI/Interface/TUiColors';
import { getBackgroundColor, getTextColor } from '../../Design/color/colorCalculatorForComponet';
import { TLayer } from '@/Components/UI/Interface/TLayer';
import { TTheme } from '@/Components/UI/Interface/TTheme';

const DateOutputButton = styled.button<{ $isActive?: boolean; theme: TTheme; $themeType?: TUiColors; $layer?: TLayer }>`
const DateOutputButton = styled.button<{ $isActive?: boolean; theme: TTheme; $themeType?: TThemeTypes; $layer?: TLayer }>`
text-align: center;
width: 100%;
background-color: ${({ theme, $isActive, $themeType = 'primary', $layer = 2 }) =>
Expand All @@ -29,7 +29,7 @@ interface IDateOutput {
date?: Date;
isActive?: boolean;
onClick?: () => void;
themeType?: TUiColors;
themeType?: TThemeTypes;
layer?: TLayer;
}
export default function DateOutput({ date = new Date(), isActive, onClick, themeType, layer }: IDateOutput) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { styled, css } from 'styled-components';

import { boxShadow } from '../../Design/shadows';
import { boxShadow } from '../../Design/shadows/shadows';
import { TTheme } from '@/Components/UI/Interface/TTheme';

//this calculates the spacing from left and right or nothing
Expand Down
5 changes: 3 additions & 2 deletions src/Components/UI/Atoms/FancyBox/FancyBox.model.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { CSSProp } from 'styled-components';
import { TLayer } from '@/Components/UI/Interface/TLayer';
import { TUiColors } from '@/Components/UI/Interface/TUiColors';
import { TThemeTypes } from '@/Components/UI/Interface/TUiColors';

type HTMLDivElementProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'style'>;
interface IFancyBox {
as?: keyof JSX.IntrinsicElements;
outlined?: boolean;
layer?: TLayer;
themeType?: TUiColors;
themeType?: TThemeTypes;
children?: React.ReactNode;
outlinedBackgroundStrength?: number;
externalStyle?: CSSProp;
Expand Down
2 changes: 1 addition & 1 deletion src/Components/UI/Atoms/FancyBox/FancyBox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { css } from 'styled-components';
import { FancyMiniProfile } from '../../Molecules/FancyMiniProfile';
import { HeaderTitleWithLogo } from '../../Molecules/HeaderTitleWithLogo';
import { FancyBottomBarIcon } from '../../Templates/FancyBottomBarIcon';
import SVGCheckMark from '../../SVGIcons/SVGCheckMark';
import SVGCheckMark from '../../SVGIcons/SVGCheckMark/SVGCheckMark';
import React from 'react';
import { FancySearchBar } from '../../Organisms/FancySearchBar';

Expand Down
4 changes: 2 additions & 2 deletions src/Components/UI/Atoms/FancyBox/FancyBox.style.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { styled } from 'styled-components';

import generateThemeForCard from '../../HelperFunctions/designFunctions/generateThemeForCard/generateThemeForCard';
import generateThemeForCard from '../../Design/designFunctions/generateThemeForCard/generateThemeForCard';
import IStyledPrefixAndPicker from '../../Interface/IStyledPrefixAndPicker.model';
import { IFancyBoxProps } from './FancyBox.model';
import { TTheme } from '@/Components/UI/Interface/TTheme';

// the styled-component for the FancyBar
type IStyledFancyBox = IStyledPrefixAndPicker<IFancyBoxProps> & { theme: TTheme };
export const StyledFancyBar = styled.div<IStyledFancyBox>`
export const StyledFancyBox = styled.div<IStyledFancyBox>`
box-sizing: border-box;
${({ $themeType, theme, $layer, $outlined, $outlinedBackgroundStrength }) =>
generateThemeForCard({ $themeType, theme, $outlined, $layer, $outlinedBackgroundStrength })};
Expand Down
8 changes: 4 additions & 4 deletions src/Components/UI/Atoms/FancyBox/FancyBox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { IFancyBoxProps } from './FancyBox.model';
import { StyledFancyBar } from './FancyBox.style';
import { StyledFancyBox } from './FancyBox.style';

// --------------------------------------------------------------------------- //
// ------------ A Bar that can usesd for for the most components ------------ //
Expand All @@ -10,14 +10,14 @@ export default function FancyBar(props: IFancyBoxProps) {
const { layer, themeType, outlined, outlinedBackgroundStrength, externalStyle } = props;

return (
<StyledFancyBar
<StyledFancyBox
$layer={layer}
$themeType={themeType}
$outlined={outlined}
$themeType={themeType}
$externalStyle={externalStyle}
$outlinedBackgroundStrength={outlinedBackgroundStrength}
>
{props.children}
</StyledFancyBar>
</StyledFancyBox>
);
}
6 changes: 3 additions & 3 deletions src/Components/UI/Atoms/FancyCard/Card.model.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { IRoundedEdges } from '../../HelperFunctions/designFunctions/edgeCaluculation';
import { IRoundedEdges } from '../../Design/designFunctions/edgeCaluculation';
import { TLayer } from '@/Components/UI/Interface/TLayer';
import { TBorderRadiusSizes } from '@/Components/UI/Interface/TBorderRadius';
import { TUiColors } from '@/Components/UI/Interface/TUiColors';
import { TThemeTypes } from '@/Components/UI/Interface/TUiColors';
import { TSpacings } from '@/Components/UI/Interface/TSpacings';

// the scaling types for the card
type IScaling = '100%' | 'auto' | string;
// the raw styling props for the card
export interface StyledCardProps {
themeType?: TUiColors;
themeType?: TThemeTypes;
textLayer?: TLayer;
height?: IScaling;
width?: IScaling;
Expand Down
4 changes: 2 additions & 2 deletions src/Components/UI/Atoms/FancyCard/FancyCard.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { styled } from 'styled-components';
import { StyledCardProps } from './Card.model';
import IStyledPrefixAndOmiter from '../../Interface/IStyledPrefixAndOmiter.model';
import { spacingPx } from '../../Design/designSizes';
import edgeCalculation from '../../HelperFunctions/designFunctions/edgeCaluculation';
import edgeCalculation from '../../Design/designFunctions/edgeCaluculation';

import { boxShadow } from '../../Design/shadows';
import { boxShadow } from '../../Design/shadows/shadows';
import getColorsForComponent from '../../Design/color/colorCalculatorForComponet';
import { TTheme } from '@/Components/UI/Interface/TTheme';

Expand Down
Loading

0 comments on commit c466ad5

Please sign in to comment.