@rango-dev/ui 0.38.1-next.0 → 0.38.1-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Header/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,MAAM,EACN,KAAK,GACN,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBAc9B"}
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Header/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,MAAM,EACN,KAAK,GACN,EAAE,iBAAiB,CAAC,SAAS,CAAC,qBAmC9B"}
@@ -1,5 +1,167 @@
1
1
  export declare const globalHeaderStyles: () => string;
2
- export declare const Container: import("@stitches/react/types/styled-component.js").StyledComponent<"div", {}, {
2
+ export declare const Container: import("@stitches/react/types/styled-component.js").StyledComponent<"div", {
3
+ titlePosition?: "center" | "left" | "right" | undefined;
4
+ }, {
5
+ xs: string;
6
+ sm: string;
7
+ md: string;
8
+ lg: string;
9
+ }, import("@stitches/react/types/css-util.js").CSS<{
10
+ xs: string;
11
+ sm: string;
12
+ md: string;
13
+ lg: string;
14
+ }, {
15
+ colors: {
16
+ primary: string;
17
+ primary500: string;
18
+ primary550: string;
19
+ secondary: string;
20
+ secondary100: string;
21
+ secondary150: string;
22
+ secondary200: string;
23
+ secondary250: string;
24
+ secondary500: string;
25
+ secondary550: string;
26
+ neutral: string;
27
+ neutral100: string;
28
+ neutral200: string;
29
+ neutral300: string;
30
+ neutral400: string;
31
+ neutral500: string;
32
+ neutral600: string;
33
+ neutral700: string;
34
+ neutral800: string;
35
+ neutral900: string;
36
+ error100: string;
37
+ error300: string;
38
+ error500: string;
39
+ error600: string;
40
+ error700: string;
41
+ warning100: string;
42
+ warning300: string;
43
+ warning500: string;
44
+ warning600: string;
45
+ warning700: string;
46
+ info: string;
47
+ info100: string;
48
+ info300: string;
49
+ info500: string;
50
+ info600: string;
51
+ info700: string;
52
+ success100: string;
53
+ success300: string;
54
+ success500: string;
55
+ success600: string;
56
+ success700: string;
57
+ background: string;
58
+ foreground: string;
59
+ };
60
+ space: {
61
+ 0: string;
62
+ 5: string;
63
+ 10: string;
64
+ 15: string;
65
+ 20: string;
66
+ 25: string;
67
+ 30: string;
68
+ 40: string;
69
+ 46: string;
70
+ 50: string;
71
+ 60: string;
72
+ 70: string;
73
+ 80: string;
74
+ 90: string;
75
+ 100: string;
76
+ 2: string;
77
+ 4: string;
78
+ 6: string;
79
+ 8: string;
80
+ 12: string;
81
+ 16: string;
82
+ 24: string;
83
+ 28: string;
84
+ 32: string;
85
+ 36: string;
86
+ };
87
+ radii: {
88
+ xs: string;
89
+ sm: string;
90
+ xm: string;
91
+ md: string;
92
+ xl: string;
93
+ lg: string;
94
+ primary: string;
95
+ secondary: string;
96
+ };
97
+ fontSizes: {
98
+ 10: string;
99
+ 12: string;
100
+ 14: string;
101
+ 16: string;
102
+ 18: string;
103
+ 20: string;
104
+ 22: string;
105
+ 24: string;
106
+ 28: string;
107
+ 32: string;
108
+ 36: string;
109
+ 40: string;
110
+ 48: string;
111
+ };
112
+ fonts: {
113
+ primary: string;
114
+ widget: string;
115
+ };
116
+ fontWeights: {
117
+ regular: number;
118
+ medium: number;
119
+ semiBold: number;
120
+ bold: number;
121
+ };
122
+ lineHeights: {
123
+ 12: string;
124
+ 16: string;
125
+ 20: string;
126
+ 24: string;
127
+ 26: string;
128
+ 28: string;
129
+ 30: string;
130
+ 36: string;
131
+ 40: string;
132
+ 44: string;
133
+ 52: string;
134
+ 64: string;
135
+ };
136
+ letterSpacings: {};
137
+ sizes: {
138
+ 4: string;
139
+ 6: string;
140
+ 8: string;
141
+ 10: string;
142
+ 12: string;
143
+ 16: string;
144
+ 18: string;
145
+ 20: string;
146
+ 24: string;
147
+ 26: string;
148
+ 28: string;
149
+ 30: string;
150
+ 32: string;
151
+ 36: string;
152
+ 40: string;
153
+ 45: string;
154
+ 48: string;
155
+ };
156
+ borderWidths: {};
157
+ borderStyles: {};
158
+ shadows: {
159
+ mainContainer: string;
160
+ };
161
+ zIndices: {};
162
+ transitions: {};
163
+ }, import("@stitches/react/types/config.js").DefaultThemeMap, {}>>;
164
+ export declare const Prefix: import("@stitches/react/types/styled-component.js").StyledComponent<"div", {}, {
3
165
  xs: string;
4
166
  sm: string;
5
167
  md: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Header.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Header/Header.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,cAM7B,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEA6CpB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAIjB,CAAC"}
1
+ {"version":3,"file":"Header.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Header/Header.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,cAM7B,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEA0DpB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAMjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAMjB,CAAC"}
@@ -2,6 +2,6 @@
2
2
  export interface PropTypes {
3
3
  prefix?: React.ReactNode;
4
4
  suffix?: React.ReactNode;
5
- title: string;
5
+ title?: string | React.ReactNode;
6
6
  }
7
7
  //# sourceMappingURL=Header.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Header/Header.types.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"Header.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Header/Header.types.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CAClC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/ui",
3
- "version": "0.38.1-next.0",
3
+ "version": "0.38.1-next.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -14,7 +14,6 @@ export const globalHeaderStyles = globalCss({
14
14
 
15
15
  export const Container = styled('div', {
16
16
  display: 'flex',
17
- justifyContent: 'space-between',
18
17
  alignItems: 'center',
19
18
  padding: '$20 $20 $15 $20',
20
19
  $$color: '$colors$neutral100',
@@ -24,6 +23,20 @@ export const Container = styled('div', {
24
23
  backgroundColor: '$$color',
25
24
  position: 'relative',
26
25
 
26
+ variants: {
27
+ titlePosition: {
28
+ left: {
29
+ justifyContent: 'start',
30
+ },
31
+ center: {
32
+ justifyContent: 'center',
33
+ },
34
+ right: {
35
+ justifyContent: 'end',
36
+ },
37
+ },
38
+ },
39
+
27
40
  '.rng-curve-left,.rng-curve-right': {
28
41
  width: HEADER_CORNDER_RADIUS * 2,
29
42
  height: HEADER_CORNDER_RADIUS * 2,
@@ -59,7 +72,17 @@ export const Container = styled('div', {
59
72
  },
60
73
  });
61
74
 
75
+ export const Prefix = styled('div', {
76
+ position: 'absolute',
77
+ left: '$20',
78
+ display: 'flex',
79
+ alignItems: 'center',
80
+ gap: '$5',
81
+ });
82
+
62
83
  export const Suffix = styled('div', {
84
+ position: 'absolute',
85
+ right: '$20',
63
86
  display: 'flex',
64
87
  alignItems: 'center',
65
88
  gap: '$5',
@@ -5,7 +5,7 @@ import React from 'react';
5
5
 
6
6
  import { Typography } from '../Typography/index.js';
7
7
 
8
- import { Container, globalHeaderStyles, Suffix } from './Header.styles.js';
8
+ import { Container, globalHeaderStyles, Prefix, Suffix } from './Header.styles';
9
9
 
10
10
  export function Header({
11
11
  prefix,
@@ -14,12 +14,33 @@ export function Header({
14
14
  }: PropsWithChildren<PropTypes>) {
15
15
  globalHeaderStyles();
16
16
 
17
+ const getTitlePosition = () => {
18
+ if (!prefix) {
19
+ return 'left';
20
+ }
21
+ if (!suffix) {
22
+ return 'right';
23
+ }
24
+ return 'center';
25
+ };
26
+
27
+ const renderTitle = () => {
28
+ if (!title) {
29
+ return null;
30
+ } else if (typeof title === 'string') {
31
+ return (
32
+ <Typography variant="headline" size="small">
33
+ {title}
34
+ </Typography>
35
+ );
36
+ }
37
+ return title;
38
+ };
39
+
17
40
  return (
18
- <Container>
19
- {prefix}
20
- <Typography variant="headline" size="small">
21
- {title}
22
- </Typography>
41
+ <Container titlePosition={getTitlePosition()}>
42
+ <Prefix>{prefix}</Prefix>
43
+ {renderTitle()}
23
44
  <Suffix>{suffix}</Suffix>
24
45
  <div className="rng-curve-left"></div>
25
46
  <div className="rng-curve-right"></div>
@@ -1,5 +1,5 @@
1
1
  export interface PropTypes {
2
2
  prefix?: React.ReactNode;
3
3
  suffix?: React.ReactNode;
4
- title: string;
4
+ title?: string | React.ReactNode;
5
5
  }
@@ -1,7 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { Header } from './Header.js';
3
- declare const meta: Meta<typeof Header>;
4
- export default meta;
5
- type Story = StoryObj<typeof Header>;
6
- export declare const Main: Story;
7
- //# sourceMappingURL=Header.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Header.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Header/Header.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAE7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC"}
@@ -1,18 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Header } from './Header.js';
4
-
5
- const meta: Meta<typeof Header> = {
6
- component: Header,
7
- };
8
-
9
- export default meta;
10
- type Story = StoryObj<typeof Header>;
11
-
12
- export const Main: Story = {
13
- args: {
14
- title: 'Swap',
15
- prefix: 'hello',
16
- suffix: 'world',
17
- },
18
- };