Skip to content

Commit

Permalink
Style fixs (#18)
Browse files Browse the repository at this point in the history
* chore: wip

* chore: update bpm version
  • Loading branch information
alonkeyval authored May 12, 2024
1 parent 1b56ebf commit a57ba1c
Show file tree
Hide file tree
Showing 15 changed files with 415 additions and 419 deletions.
17 changes: 4 additions & 13 deletions dist/index.d.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, ChangeEvent, ReactNode } from 'react';
import React, { FC, ChangeEvent, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes } from 'react';

interface RadioButtonProps {
label?: string;
Expand All @@ -9,13 +9,9 @@ interface RadioButtonProps {
}
declare const RadioButton: FC<RadioButtonProps>;

interface ButtonProps {
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: string;
children: JSX.Element | JSX.Element[];
onClick?: () => void;
style?: object;
disabled?: boolean;
type?: 'button' | 'submit' | 'reset' | undefined;
}
declare const Button: FC<ButtonProps>;

Expand Down Expand Up @@ -154,19 +150,14 @@ interface ImageProps {
}
declare function ImageComponent({ src, alt, width, height, style, }: ImageProps): React.JSX.Element;

interface InputProps$1 {
interface InputProps$1 extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
label?: string;
value: string;
onChange: (value: string) => void;
type?: string;
error?: string;
style?: React.CSSProperties;
placeholder?: string;
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
tooltip?: string;
required?: boolean;
}
declare function Input({ label, value, onChange, type, error, style, placeholder, onKeyDown, tooltip, required, }: InputProps$1): JSX.Element;
declare function Input({ label, value, onChange, type, error, style, onKeyDown, tooltip, required, autoComplete, ...rest }: InputProps$1): JSX.Element;

interface InputProps {
value: string;
Expand Down
17 changes: 4 additions & 13 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, ChangeEvent, ReactNode } from 'react';
import React, { FC, ChangeEvent, ButtonHTMLAttributes, ReactNode, InputHTMLAttributes } from 'react';

interface RadioButtonProps {
label?: string;
Expand All @@ -9,13 +9,9 @@ interface RadioButtonProps {
}
declare const RadioButton: FC<RadioButtonProps>;

interface ButtonProps {
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: string;
children: JSX.Element | JSX.Element[];
onClick?: () => void;
style?: object;
disabled?: boolean;
type?: 'button' | 'submit' | 'reset' | undefined;
}
declare const Button: FC<ButtonProps>;

Expand Down Expand Up @@ -154,19 +150,14 @@ interface ImageProps {
}
declare function ImageComponent({ src, alt, width, height, style, }: ImageProps): React.JSX.Element;

interface InputProps$1 {
interface InputProps$1 extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
label?: string;
value: string;
onChange: (value: string) => void;
type?: string;
error?: string;
style?: React.CSSProperties;
placeholder?: string;
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
tooltip?: string;
required?: boolean;
}
declare function Input({ label, value, onChange, type, error, style, placeholder, onKeyDown, tooltip, required, }: InputProps$1): JSX.Element;
declare function Input({ label, value, onChange, type, error, style, onKeyDown, tooltip, required, autoComplete, ...rest }: InputProps$1): JSX.Element;

interface InputProps {
value: string;
Expand Down
293 changes: 155 additions & 138 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

441 changes: 215 additions & 226 deletions dist/index.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keyval-dev/design-system",
"version": "1.7.8",
"version": "1.8.3",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
18 changes: 17 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
'use client';
import { MultiInputTable } from '@/design.system';
import { Checkbox, DataFlow, MultiInputTable } from '@/design.system';
import { edges, nodes } from '@/design.system/data.flow/builder';
import React from 'react';

export default function Home() {
const [values, setValues] = React.useState<string[]>(['']);
const [checked, setChecked] = React.useState(false);
return (
<div style={{ background: '#0E1C28', height: '100vh', padding: 150 }}>
<MultiInputTable
Expand All @@ -14,6 +16,20 @@ export default function Home() {
required
onValuesChange={(newValues: string[]) => setValues(newValues)}
/>
<div>
<Checkbox
label="I agree to the terms and conditions"
value={checked}
onChange={() => setChecked(!checked)}
/>
<br />
<Checkbox
label="I agree to the terms and conditions"
value={checked}
onChange={() => setChecked(!checked)}
/>
</div>
<DataFlow nodes={nodes} edges={edges} />
</div>
);
}
3 changes: 2 additions & 1 deletion src/assets/icons/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import AddClusterInfo from './cluster-attr.svg';
import DeleteAttribute from './delete-attr.svg';
import RenameAttribute from './rename-attr.svg';
// Define the type for the ACTION_ICONS object
interface ActionIcons {
[key: string]: any;
Expand All @@ -8,6 +9,6 @@ interface ActionIcons {
// Define the ACTION_ICONS with explicit types
export const ACTION_ICONS: ActionIcons = {
AddClusterInfo: AddClusterInfo,
filter: AddClusterInfo,
RenameAttribute: RenameAttribute,
DeleteAttribute: DeleteAttribute,
};
1 change: 1 addition & 0 deletions src/assets/icons/actions/rename-attr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/languages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const LANGUAGES_LOGOS = {
javascript: `${BASE_URL}nodejs.png`,
python: `${BASE_URL}python.png`,
dotnet: `${BASE_URL}dotnet.png`,
default: `${BASE_URL}go.png`,
default: `${BASE_URL}default.png`,
mysql: `${BASE_URL}mysql.png`,
};

Expand Down
10 changes: 5 additions & 5 deletions src/design.system/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Text } from "../text/text";
import { CheckboxWrapper, CheckboxItem } from "./checkbox.styled";
import Checked from "../../assets/icons/checkbox-rect.svg";
import React from 'react';
import { Text } from '../text/text';
import { CheckboxWrapper, CheckboxItem } from './checkbox.styled';
import Checked from '../../assets/icons/checkbox-rect.svg';

interface CheckboxProps {
value: boolean;
Expand All @@ -13,7 +13,7 @@ interface CheckboxProps {
export function Checkbox({
onChange,
value,
label = "",
label = '',
disabled = false,
}: CheckboxProps) {
return (
Expand Down
4 changes: 1 addition & 3 deletions src/design.system/data.flow/action.node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ const ActionContainer = styled.div`
background: ${({ theme }) => theme.colors.dark};
align-items: center;
gap: 4px;
width: 80px;
height: 80px;
min-width: 80px;
`;

const TextWrapper = styled.div`
max-width: 72px;
height: 40px;
text-align: center;
display: flex;
align-items: center;
Expand Down
8 changes: 4 additions & 4 deletions src/design.system/data.flow/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const action = [
id: 'aci-f6c9f',
type: 'AddClusterInfo',
spec: {
actionName: 'Cluster Attributes',
actionName: 'This is tetst test Cluster Attributes',
notes:
'Actions are a way to modify the OpenTelemetry data recorded by Odigos Sources, before it is exported to your Odigos Destinations.',
signals: ['METRICS', 'TRACES'],
Expand All @@ -168,7 +168,7 @@ const action = [
},
{
id: 'aci-hfgcb',
type: 'AddClusterInfo',
type: 'DeleteAttribute',
spec: {
actionName: 'Link',
notes: 'Link to docs',
Expand All @@ -187,9 +187,9 @@ const action = [
},
{
id: 'aci-r67mp',
type: 'AddClusterInfo',
type: 'RenameAttribute',
spec: {
actionName: 'Initialize',
actionName: 'Initialize Initialize',
notes: 'This is the initialization phase of the cluster.',
signals: ['LOGS', 'METRICS', 'TRACES'],
clusterAttributes: [
Expand Down
14 changes: 3 additions & 11 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -24,9 +20,7 @@
}
],
"paths": {
"@/*": [
"./src/*"
]
"@/*": ["./src/*"]
}
},
"include": [
Expand All @@ -36,7 +30,5 @@
".next/types/**/*.ts",
"custom.d.ts"
],
"exclude": [
"node_modules"
]
"exclude": ["node_modules"]
}

0 comments on commit a57ba1c

Please sign in to comment.