commit
7cfeaee6b4
@ -0,0 +1,19 @@ |
||||
## install |
||||
|
||||
```bash |
||||
# npm |
||||
$ echo @kay:registry=https://code.juke.fr/api/packages/kay/npm/ >> .npmrc |
||||
$ npm install @kay/komponents |
||||
``` |
||||
|
||||
```bash |
||||
# yarn |
||||
echo \"@kay:registry\" \"https://code.juke.fr/api/packages/kay/npm/\" >> .yarnrc |
||||
$ yarn add @kay/komponents |
||||
``` |
||||
|
||||
## usage |
||||
|
||||
### storybook |
||||
|
||||
a storybook is availble on [komponents.comfy.center](https://komponents.comfy.center) |
@ -0,0 +1,3 @@ |
||||
node_modules |
||||
dist |
||||
storybook-static |
@ -0,0 +1,28 @@ |
||||
module.exports = { |
||||
root: true, |
||||
parser: '@typescript-eslint/parser', |
||||
// Specifies the ESLint parser
|
||||
extends: ['plugin:react/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@next/next/recommended', 'plugin:prettier/recommended', 'plugin:storybook/recommended'], |
||||
parserOptions: { |
||||
ecmaVersion: 2018, |
||||
// Allows for the parsing of modern ECMAScript features
|
||||
sourceType: 'module', |
||||
// Allows for the use of imports
|
||||
ecmaFeatures: { |
||||
jsx: true // Allows for the parsing of JSX
|
||||
|
||||
} |
||||
}, |
||||
rules: { |
||||
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
|
||||
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
|
||||
'react/prop-types': 'off', |
||||
'react/react-in-jsx-scope': 'off' |
||||
}, |
||||
settings: { |
||||
react: { |
||||
version: 'detect' // Tells eslint-plugin-react to automatically detect the version of React to use
|
||||
|
||||
} |
||||
} |
||||
}; |
@ -0,0 +1,4 @@ |
||||
node_modules |
||||
dist |
||||
yarn-error.log |
||||
storybook-static |
@ -0,0 +1,36 @@ |
||||
--- |
||||
include: |
||||
- template: Auto-DevOps.gitlab-ci.yml |
||||
- project: 'kay/ci-templates' |
||||
file: |
||||
- '/Semantic-Release.gitlab-ci.yml' |
||||
|
||||
variables: |
||||
# TEST_DISABLED: 'true' |
||||
# CODE_QUALITY_DISABLED: "true" |
||||
# LICENSE_MANAGEMENT_DISABLED: "true" |
||||
# BROWSER_PERFORMANCE_DISABLED: "true" |
||||
# LOAD_PERFORMANCE_DISABLED: "true" |
||||
# SAST_DISABLED: "true" |
||||
# SECRET_DETECTION_DISABLED: "true" |
||||
# DEPENDENCY_SCANNING_DISABLED: "true" |
||||
# CONTAINER_SCANNING_DISABLED: "true" |
||||
# DAST_DISABLED: "true" |
||||
# REVIEW_DISABLED: "true" |
||||
# CODE_INTELLIGENCE_DISABLED: "true" |
||||
# CLUSTER_IMAGE_SCANNING_DISABLED: "true" |
||||
POSTGRES_ENABLED: 'false' |
||||
CACHE_PATH: /tmp/cache |
||||
|
||||
cache: |
||||
key: shared-cache |
||||
paths: |
||||
- /tmp/cache |
||||
|
||||
test: |
||||
variables: |
||||
BUILDPACK_URL: https://code.eutychia.org/kay/heroku-buildpack-nodejs-playwright |
||||
|
||||
production: |
||||
environment: |
||||
url: 'http://komponents.$KUBE_INGRESS_BASE_DOMAIN' |
@ -0,0 +1,5 @@ |
||||
.eslint.js |
||||
.gitlab-ci.yml |
||||
.prettierrc.js |
||||
src |
||||
node_modules |
@ -0,0 +1,7 @@ |
||||
module.exports = { |
||||
semi: true, |
||||
trailingComma: 'all', |
||||
singleQuote: true, |
||||
printWidth: 80, |
||||
tabWidth: 2, |
||||
}; |
@ -0,0 +1,29 @@ |
||||
module.exports = { |
||||
stories: [ |
||||
'../stories/*.stories.mdx', |
||||
'../stories/**/*.stories.mdx', |
||||
'../stories/**/*.stories.@(js|jsx|ts|tsx)', |
||||
], |
||||
addons: [ |
||||
'@storybook/addon-links', |
||||
'@storybook/addon-essentials', |
||||
'@storybook/addon-interactions', |
||||
'@storybook/addon-a11y', |
||||
'@storybook/addon-storysource', |
||||
'@chakra-ui/storybook-addon', |
||||
'@a110/storybook-expand-all', |
||||
], |
||||
framework: '@storybook/react', |
||||
core: { |
||||
builder: '@storybook/builder-webpack5', |
||||
}, |
||||
refs: { |
||||
'@chakra-ui/react': { disable: true }, |
||||
}, |
||||
features: { |
||||
buildStoriesJson: true, |
||||
previewMdx2: true, |
||||
emotionAlias: false, |
||||
interactionsDebugger: true, |
||||
}, |
||||
}; |
@ -0,0 +1,14 @@ |
||||
import { draculaTheme } from '../src/Chakra/draculaTheme'; |
||||
|
||||
export const parameters = { |
||||
actions: { argTypesRegex: '^on[A-Z].*' }, |
||||
controls: { |
||||
matchers: { |
||||
color: /(background|color)$/i, |
||||
date: /Date$/, |
||||
}, |
||||
}, |
||||
chakra: { |
||||
theme: draculaTheme, |
||||
}, |
||||
}; |
@ -0,0 +1,19 @@ |
||||
const { injectAxe, checkA11y } = require('axe-playwright'); |
||||
|
||||
/* |
||||
* See https://storybook.js.org/docs/react/writing-tests/test-runner#test-hook-api-experimental
|
||||
* to learn more about the test-runner hooks API. |
||||
*/ |
||||
module.exports = { |
||||
async preRender(page) { |
||||
await injectAxe(page); |
||||
}, |
||||
async postRender(page) { |
||||
await checkA11y(page, '#root', { |
||||
detailedReport: true, |
||||
detailedReportOptions: { |
||||
html: true, |
||||
}, |
||||
}); |
||||
}, |
||||
}; |
@ -0,0 +1,121 @@ |
||||
# [1.6.0](https://code.eutychia.org/kay/komponents/compare/v1.5.0...v1.6.0) (2022-06-28) |
||||
|
||||
|
||||
### Features |
||||
|
||||
* Try to add cache on builds ([db5abc3](https://code.eutychia.org/kay/komponents/commit/db5abc3a5f69b0fdea1f094c43f4cdde81a2a5c4)) |
||||
* Try to add cache on builds ([e5222fc](https://code.eutychia.org/kay/komponents/commit/e5222fcee6c49f7abe9fe414eff79953610db941)) |
||||
|
||||
# [1.5.0](https://code.eutychia.org/kay/komponents/compare/v1.4.0...v1.5.0) (2022-06-28) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Add header export ([8858f5a](https://code.eutychia.org/kay/komponents/commit/8858f5a3d05c48c20068d408f4de7b9b7aeb71ac)) |
||||
|
||||
|
||||
### Features |
||||
|
||||
* Header ([b74ad77](https://code.eutychia.org/kay/komponents/commit/b74ad7706921b3676152bcc9a9c1e65734679b96)) |
||||
|
||||
# [1.4.0](https://code.eutychia.org/kay/komponents/compare/v1.3.0...v1.4.0) (2022-06-28) |
||||
|
||||
|
||||
### Features |
||||
|
||||
* Make it pogger ([6f5c5bb](https://code.eutychia.org/kay/komponents/commit/6f5c5bb3cb4376d989d3eb51a82ef5e7b5cf2646)) |
||||
|
||||
# [1.3.0](https://code.eutychia.org/kay/komponents/compare/v1.2.0...v1.3.0) (2022-06-28) |
||||
|
||||
|
||||
### Features |
||||
|
||||
* Make it pog ([3412b65](https://code.eutychia.org/kay/komponents/commit/3412b65a81e1acc59f59a1404e2e5b421f62c425)) |
||||
|
||||
# [1.2.0](https://code.eutychia.org/kay/komponents/compare/v1.1.1...v1.2.0) (2022-06-28) |
||||
|
||||
|
||||
### Features |
||||
|
||||
* Storybook improvements ([0f4c64f](https://code.eutychia.org/kay/komponents/commit/0f4c64f1130eea247df1be03e66593d1dbc7a63f)) |
||||
|
||||
## [1.1.1](https://code.eutychia.org/kay/komponents/compare/v1.1.0...v1.1.1) (2022-06-28) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Build storybook as prod ([c57beed](https://code.eutychia.org/kay/komponents/commit/c57beed6afe3f9879810f308eb9b2c547a21c150)) |
||||
|
||||
# [1.1.0](https://code.eutychia.org/kay/komponents/compare/v1.0.7...v1.1.0) (2022-06-28) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Remove package lock ([d1eea5d](https://code.eutychia.org/kay/komponents/commit/d1eea5da8730dc2180f209d24ce6d544152377a5)) |
||||
|
||||
|
||||
### Features |
||||
|
||||
* Add storybook ([d390deb](https://code.eutychia.org/kay/komponents/commit/d390deb221b5589446b32d437bd9e1ad83876f2b)) |
||||
* Move stories ([c6c4314](https://code.eutychia.org/kay/komponents/commit/c6c4314936a85c027bbe626f33e2ab7c2aa1caea)) |
||||
|
||||
## [1.0.7](https://code.eutychia.org/kay/komponents/compare/v1.0.6...v1.0.7) (2022-06-26) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Theme should be a var not a function ([de4babb](https://code.eutychia.org/kay/komponents/commit/de4babbfa50b64def052810da6f3156420568fd3)) |
||||
|
||||
## [1.0.6](https://code.eutychia.org/kay/komponents/compare/v1.0.5...v1.0.6) (2022-06-26) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* a ([d1654ad](https://code.eutychia.org/kay/komponents/commit/d1654ad8e397e2d6689c030a00672b3a686924e7)) |
||||
|
||||
## [1.0.5](https://code.eutychia.org/kay/komponents/compare/v1.0.4...v1.0.5) (2022-06-26) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Send help ([e738e76](https://code.eutychia.org/kay/komponents/commit/e738e76cbb38fd02996defacc6411c287427a8c5)) |
||||
|
||||
## [1.0.4](https://code.eutychia.org/kay/komponents/compare/v1.0.3...v1.0.4) (2022-06-26) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* I don't know why it doesnt work henlp ([996617c](https://code.eutychia.org/kay/komponents/commit/996617cef3ac5b95c40351aef80bd5384a29e3b8)) |
||||
|
||||
## [1.0.3](https://code.eutychia.org/kay/komponents/compare/v1.0.2...v1.0.3) (2022-06-26) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Fix build (again) ([c1cd9e6](https://code.eutychia.org/kay/komponents/commit/c1cd9e663a819ede0a3c5053d1f5e022ccbe5ba5)) |
||||
|
||||
## [1.0.2](https://code.eutychia.org/kay/komponents/compare/v1.0.1...v1.0.2) (2022-06-26) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Fix build ([0c20c50](https://code.eutychia.org/kay/komponents/commit/0c20c502556720810f3ad48f7cdb61981b3f0236)) |
||||
|
||||
## [1.0.1](https://code.eutychia.org/kay/komponents/compare/v1.0.0...v1.0.1) (2022-06-26) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Fix build and release ([86f726a](https://code.eutychia.org/kay/komponents/commit/86f726a2624aa74bbdb770e8c606716dab4db183)) |
||||
|
||||
# 1.0.0 (2022-06-26) |
||||
|
||||
|
||||
### Bug Fixes |
||||
|
||||
* Package name ([bd8b077](https://code.eutychia.org/kay/komponents/commit/bd8b0771673a3d0947840d9dd6924fd075b759eb)) |
||||
|
||||
|
||||
### Features |
||||
|
||||
* Initialize project ([1ca6ad3](https://code.eutychia.org/kay/komponents/commit/1ca6ad3789ff23d7127f60d11431abb00e2b1719)) |
@ -0,0 +1,32 @@ |
||||
FROM node:16-alpine AS deps |
||||
WORKDIR /app |
||||
COPY package.json yarn.lock ./ |
||||
RUN yarn install --frozen-lockfile |
||||
|
||||
FROM node:16-alpine AS builder |
||||
WORKDIR /app |
||||
COPY --from=deps /app/node_modules ./node_modules |
||||
COPY . . |
||||
ENV NODE_ENV production |
||||
RUN yarn build-storybook |
||||
|
||||
FROM node:16-alpine AS runner |
||||
WORKDIR /app |
||||
|
||||
ENV NODE_ENV production |
||||
|
||||
RUN addgroup --system --gid 1001 nodejs |
||||
RUN adduser --system --uid 1001 runner |
||||
|
||||
COPY --from=builder /app/package.json ./package.json |
||||
COPY --from=builder --chown=runner:nodejs /app/storybook-static ./ |
||||
|
||||
RUN npm i -g http-server |
||||
|
||||
USER runner |
||||
|
||||
EXPOSE 5000 |
||||
ENV PORT 5000 |
||||
|
||||
CMD ["http-server"] |
||||
|
@ -0,0 +1,459 @@ |
||||
Attribution-NonCommercial-ShareAlike 4.0 International AntiFascistEdit |
||||
|
||||
======================================================================= |
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and |
||||
does not provide legal services or legal advice. Distribution of |
||||
Creative Commons public licenses does not create a lawyer-client or |
||||
other relationship. Creative Commons makes its licenses and related |
||||
information available on an "as-is" basis. Creative Commons gives no |
||||
warranties regarding its licenses, any material licensed under their |
||||
terms and conditions, or any related information. Creative Commons |
||||
disclaims all liability for damages resulting from their use to the |
||||
fullest extent possible. |
||||
|
||||
Using Creative Commons Public Licenses |
||||
|
||||
Creative Commons public licenses provide a standard set of terms and |
||||
conditions that creators and other rights holders may use to share |
||||
original works of authorship and other material subject to copyright |
||||
and certain other rights specified in the public license below. The |
||||
following considerations are for informational purposes only, are not |
||||
exhaustive, and do not form part of our licenses. |
||||
|
||||
Considerations for licensors: Our public licenses are |
||||
intended for use by those authorized to give the public |
||||
permission to use material in ways otherwise restricted by |
||||
copyright and certain other rights. Our licenses are |
||||
irrevocable. Licensors should read and understand the terms |
||||
and conditions of the license they choose before applying it. |
||||
Licensors should also secure all rights necessary before |
||||
applying our licenses so that the public can reuse the |
||||
material as expected. Licensors should clearly mark any |
||||
material not subject to the license. This includes other CC- |
||||
licensed material, or material used under an exception or |
||||
limitation to copyright. More considerations for licensors: |
||||
wiki.creativecommons.org/Considerations_for_licensors |
||||
|
||||
Considerations for the public: By using one of our public |
||||
licenses, a licensor grants the public permission to use the |
||||
licensed material under specified terms and conditions. If |
||||
the licensor's permission is not necessary for any reason--for |
||||
example, because of any applicable exception or limitation to |
||||
copyright--then that use is not regulated by the license. Our |
||||
licenses grant only permissions under copyright and certain |
||||
other rights that a licensor has authority to grant. Use of |
||||
the licensed material may still be restricted for other |
||||
reasons, including because others have copyright or other |
||||
rights in the material. A licensor may make special requests, |
||||
such as asking that all changes be marked or described. |
||||
Although not required by our licenses, you are encouraged to |
||||
respect those requests where reasonable. More considerations |
||||
for the public: |
||||
wiki.creativecommons.org/Considerations_for_licensees |
||||
|
||||
======================================================================= |
||||
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International |
||||
Public License |
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree |
||||
to be bound by the terms and conditions of this Creative Commons |
||||
Attribution-NonCommercial-ShareAlike 4.0 International Public License |
||||
("Public License"). To the extent this Public License may be |
||||
interpreted as a contract, You are granted the Licensed Rights in |
||||
consideration of Your acceptance of these terms and conditions, and the |
||||
Licensor grants You such rights in consideration of benefits the |
||||
Licensor receives from making the Licensed Material available under |
||||
these terms and conditions. |
||||
|
||||
|
||||
Section 1 -- Definitions. |
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar |
||||
Rights that is derived from or based upon the Licensed Material |
||||
and in which the Licensed Material is translated, altered, |
||||
arranged, transformed, or otherwise modified in a manner requiring |
||||
permission under the Copyright and Similar Rights held by the |
||||
Licensor. For purposes of this Public License, where the Licensed |
||||
Material is a musical work, performance, or sound recording, |
||||
Adapted Material is always produced where the Licensed Material is |
||||
synched in timed relation with a moving image. |
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright |
||||
and Similar Rights in Your contributions to Adapted Material in |
||||
accordance with the terms and conditions of this Public License. |
||||
|
||||
c. BY-NC-SA Compatible License means a license listed at |
||||
creativecommons.org/compatiblelicenses, approved by Creative |
||||
Commons as essentially the equivalent of this Public License. |
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights |
||||
closely related to copyright including, without limitation, |
||||
performance, broadcast, sound recording, and Sui Generis Database |
||||
Rights, without regard to how the rights are labeled or |
||||
categorized. For purposes of this Public License, the rights |
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar |
||||
Rights. |
||||
|
||||
e. Effective Technological Measures means those measures that, in the |
||||
absence of proper authority, may not be circumvented under laws |
||||
fulfilling obligations under Article 11 of the WIPO Copyright |
||||
Treaty adopted on December 20, 1996, and/or similar international |
||||
agreements. |
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or |
||||
any other exception or limitation to Copyright and Similar Rights |
||||
that applies to Your use of the Licensed Material. |
||||
|
||||
g. License Elements means the license attributes listed in the name |
||||
of a Creative Commons Public License. The License Elements of this |
||||
Public License are Attribution, NonCommercial, and ShareAlike. |
||||
|
||||
h. Licensed Material means the artistic or literary work, database, |
||||
or other material to which the Licensor applied this Public |
||||
License. |
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the |
||||
terms and conditions of this Public License, which are limited to |
||||
all Copyright and Similar Rights that apply to Your use of the |
||||
Licensed Material and that the Licensor has authority to license. |
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights |
||||
under this Public License. |
||||
|
||||
k. NonCommercial means not primarily intended for or directed towards |
||||
commercial advantage or monetary compensation. For purposes of |
||||
this Public License, the exchange of the Licensed Material for |
||||
other material subject to Copyright and Similar Rights by digital |
||||
file-sharing or similar means is NonCommercial provided there is |
||||
no payment of monetary compensation in connection with the |
||||
exchange. |
||||
|
||||
l. Share means to provide material to the public by any means or |
||||
process that requires permission under the Licensed Rights, such |
||||
as reproduction, public display, public performance, distribution, |
||||
dissemination, communication, or importation, and to make material |
||||
available to the public including in ways that members of the |
||||
public may access the material from a place and at a time |
||||
individually chosen by them. |
||||
|
||||
m. Sui Generis Database Rights means rights other than copyright |
||||
resulting from Directive 96/9/EC of the European Parliament and of |
||||
the Council of 11 March 1996 on the legal protection of databases, |
||||
as amended and/or succeeded, as well as other essentially |
||||
equivalent rights anywhere in the world. |
||||
|
||||
n. You means the individual or entity exercising the Licensed Rights |
||||
under this Public License. Your has a corresponding meaning. |
||||
|
||||
|
||||
Section 2 -- Scope. |
||||
|
||||
a. License grant. |
||||
|
||||
1. Subject to the terms and conditions of this Public License, |
||||
the Licensor hereby grants You a worldwide, royalty-free, |
||||
non-sublicensable, non-exclusive, irrevocable license to |
||||
exercise the Licensed Rights in the Licensed Material to: |
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or |
||||
in part, for NonCommercial purposes only; and |
||||
|
||||
b. produce, reproduce, and Share Adapted Material for |
||||
NonCommercial purposes only. |
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where |
||||
Exceptions and Limitations apply to Your use, this Public |
||||
License does not apply, and You do not need to comply with |
||||
its terms and conditions. |
||||
|
||||
3. Term. The term of this Public License is specified in Section |
||||
6(a). |
||||
|
||||
4. Media and formats; technical modifications allowed. The |
||||
Licensor authorizes You to exercise the Licensed Rights in |
||||
all media and formats whether now known or hereafter created, |
||||
and to make technical modifications necessary to do so. The |
||||
Licensor waives and/or agrees not to assert any right or |
||||
authority to forbid You from making technical modifications |
||||
necessary to exercise the Licensed Rights, including |
||||
technical modifications necessary to circumvent Effective |
||||
Technological Measures. For purposes of this Public License, |
||||
simply making modifications authorized by this Section 2(a) |
||||
(4) never produces Adapted Material. |
||||
|
||||
5. Downstream recipients. |
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every |
||||
recipient of the Licensed Material automatically |
||||
receives an offer from the Licensor to exercise the |
||||
Licensed Rights under the terms and conditions of this |
||||
Public License. |
||||
|
||||
b. Additional offer from the Licensor -- Adapted Material. |
||||
Every recipient of Adapted Material from You |
||||
automatically receives an offer from the Licensor to |
||||
exercise the Licensed Rights in the Adapted Material |
||||
under the conditions of the Adapter's License You apply. |
||||
|
||||
c. No downstream restrictions. You may not offer or impose |
||||
any additional or different terms or conditions on, or |
||||
apply any Effective Technological Measures to, the |
||||
Licensed Material if doing so restricts exercise of the |
||||
Licensed Rights by any recipient of the Licensed |
||||
Material. |
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or |
||||
may be construed as permission to assert or imply that You |
||||
are, or that Your use of the Licensed Material is, connected |
||||
with, or sponsored, endorsed, or granted official status by, |
||||
the Licensor or others designated to receive attribution as |
||||
provided in Section 3(a)(1)(A)(i). |
||||
|
||||
b. Other rights. |
||||
|
||||
1. Moral rights, such as the right of integrity, are not |
||||
licensed under this Public License, nor are publicity, |
||||
privacy, and/or other similar personality rights; however, to |
||||
the extent possible, the Licensor waives and/or agrees not to |
||||
assert any such rights held by the Licensor to the limited |
||||
extent necessary to allow You to exercise the Licensed |
||||
Rights, but not otherwise. |
||||
|
||||
2. Patent and trademark rights are not licensed under this |
||||
Public License. |
||||
|
||||
3. To the extent possible, the Licensor waives any right to |
||||
collect royalties from You for the exercise of the Licensed |
||||
Rights, whether directly or through a collecting society |
||||
under any voluntary or waivable statutory or compulsory |
||||
licensing scheme. In all other cases the Licensor expressly |
||||
reserves any right to collect such royalties, including when |
||||
the Licensed Material is used other than for NonCommercial |
||||
purposes. |
||||
|
||||
|
||||
Section 3 -- License Conditions. |
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the |
||||
following conditions. |
||||
|
||||
a. Attribution. |
||||
|
||||
1. If You Share the Licensed Material (including in modified |
||||
form), You must: |
||||
|
||||
a. retain the following if it is supplied by the Licensor |
||||
with the Licensed Material: |
||||
|
||||
i. identification of the creator(s) of the Licensed |
||||
Material and any others designated to receive |
||||
attribution, in any reasonable manner requested by |
||||
the Licensor (including by pseudonym if |
||||
designated); |
||||
|
||||
ii. a copyright notice; |
||||
|
||||
iii. a notice that refers to this Public License; |
||||
|
||||
iv. a notice that refers to the disclaimer of |
||||
warranties; |
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the |
||||
extent reasonably practicable; |
||||
|
||||
b. indicate if You modified the Licensed Material and |
||||
retain an indication of any previous modifications; and |
||||
|
||||
c. indicate the Licensed Material is licensed under this |
||||
Public License, and include the text of, or the URI or |
||||
hyperlink to, this Public License. |
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any |
||||
reasonable manner based on the medium, means, and context in |
||||
which You Share the Licensed Material. For example, it may be |
||||
reasonable to satisfy the conditions by providing a URI or |
||||
hyperlink to a resource that includes the required |
||||
information. |
||||
3. If requested by the Licensor, You must remove any of the |
||||
information required by Section 3(a)(1)(A) to the extent |
||||
reasonably practicable. |
||||
|
||||
b. ShareAlike. |
||||
|
||||
In addition to the conditions in Section 3(a), if You Share |
||||
Adapted Material You produce, the following conditions also apply. |
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons |
||||
license with the same License Elements, this version or |
||||
later, or a BY-NC-SA Compatible License. |
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the |
||||
Adapter's License You apply. You may satisfy this condition |
||||
in any reasonable manner based on the medium, means, and |
||||
context in which You Share Adapted Material. |
||||
|
||||
3. You may not offer or impose any additional or different terms |
||||
or conditions on, or apply any Effective Technological |
||||
Measures to, Adapted Material that restrict exercise of the |
||||
rights granted under the Adapter's License You apply. |
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights. |
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that |
||||
apply to Your use of the Licensed Material: |
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right |
||||
to extract, reuse, reproduce, and Share all or a substantial |
||||
portion of the contents of the database for NonCommercial purposes |
||||
only; |
||||
|
||||
b. if You include all or a substantial portion of the database |
||||
contents in a database in which You have Sui Generis Database |
||||
Rights, then the database in which You have Sui Generis Database |
||||
Rights (but not its individual contents) is Adapted Material, |
||||
including for purposes of Section 3(b); and |
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share |
||||
all or a substantial portion of the contents of the database. |
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not |
||||
replace Your obligations under this Public License where the Licensed |
||||
Rights include other Copyright and Similar Rights. |
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability. |
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE |
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS |
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF |
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, |
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, |
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR |
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, |
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT |
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT |
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. |
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE |
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, |
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, |
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, |
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR |
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN |
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR |
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR |
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. |
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided |
||||
above shall be interpreted in a manner that, to the extent |
||||
possible, most closely approximates an absolute disclaimer and |
||||
waiver of all liability. |
||||
|
||||
|
||||
Section 6 -- Term and Termination. |
||||
|
||||
a. This Public License applies for the term of the Copyright and |
||||
Similar Rights licensed here. However, if You fail to comply with |
||||
this Public License, then Your rights under this Public License |
||||
terminate automatically. |
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under |
||||
Section 6(a), it reinstates: |
||||
|
||||
1. automatically as of the date the violation is cured, provided |
||||
it is cured within 30 days of Your discovery of the |
||||
violation; or |
||||
|
||||
2. upon express reinstatement by the Licensor. |
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any |
||||
right the Licensor may have to seek remedies for Your violations |
||||
of this Public License. |
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the |
||||
Licensed Material under separate terms or conditions or stop |
||||
distributing the Licensed Material at any time; however, doing so |
||||
will not terminate this Public License. |
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public |
||||
License. |
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions. |
||||
|
||||
a. The Licensor shall not be bound by any additional or different |
||||
terms or conditions communicated by You unless expressly agreed. |
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the |
||||
Licensed Material not stated herein are separate from and |
||||
independent of the terms and conditions of this Public License. |
||||
|
||||
c. The License does not apply and no license is granted for |
||||
taking action on behalf of a Nation or State or Government, |
||||
be it military, law enforcement, agent, spy, hacker, developer, |
||||
this list is not exhaustive. |
||||
|
||||
d. The License does not apply and no license is granted to actors |
||||
taking action to oppress, harm, injure, kill, whether |
||||
physically or psycholocially. |
||||
|
||||
e. The License does not apply and no license is granted to actors |
||||
acting on behalf of any party previously found guilty of committing |
||||
war crimes at any point in time. |
||||
|
||||
f. The License does not apply and no license is granted to actors |
||||
acting on behalf of any party previously found not respecting the |
||||
Universal Declaration of Human Rights at any point in time. |
||||
|
||||
g. The License does not apply and no license is granted to actors |
||||
acting with the intent of surveilling a population or the intent of |
||||
gathering information on spefific or non-specific populations and/or |
||||
target demographics. |
||||
|
||||
|
||||
Section 8 -- Interpretation. |
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and |
||||
shall not be interpreted to, reduce, limit, restrict, or impose |
||||
conditions on any use of the Licensed Material that could lawfully |
||||
be made without permission under this Public License. |
||||
|
||||
b. To the extent possible, if any provision of this Public License is |
||||
deemed unenforceable, it shall be automatically reformed to the |
||||
minimum extent necessary to make it enforceable. If the provision |
||||
cannot be reformed, it shall be severed from this Public License |
||||
without affecting the enforceability of the remaining terms and |
||||
conditions. |
||||
|
||||
c. No term or condition of this Public License will be waived and no |
||||
failure to comply consented to unless expressly agreed to by the |
||||
Licensor. |
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted |
||||
as a limitation upon, or waiver of, any privileges and immunities |
||||
that apply to the Licensor or You, including from the legal |
||||
processes of any jurisdiction or authority. |
||||
|
||||
======================================================================= |
||||
|
||||
Creative Commons is not a party to its public |
||||
licenses. Notwithstanding, Creative Commons may elect to apply one of |
||||
its public licenses to material it publishes and in those instances |
||||
will be considered the “Licensor.” The text of the Creative Commons |
||||
public licenses is dedicated to the public domain under the CC0 Public |
||||
Domain Dedication. Except for the limited purpose of indicating that |
||||
material is shared under a Creative Commons public license or as |
||||
otherwise permitted by the Creative Commons policies published at |
||||
creativecommons.org/policies, Creative Commons does not authorize the |
||||
use of the trademark "Creative Commons" or any other trademark or logo |
||||
of Creative Commons without its prior written consent including, |
||||
without limitation, in connection with any unauthorized modifications |
||||
to any of its public licenses or any other arrangements, |
||||
understandings, or agreements concerning use of licensed material. For |
||||
the avoidance of doubt, this paragraph does not form part of the |
||||
public licenses. |
||||
|
||||
Creative Commons may be contacted at creativecommons.org. |
@ -0,0 +1,77 @@ |
||||
# [komponents](https://code.juke.fr/kay/komponents) |
||||
common react components reused in my projects komponents.comfy.center |
||||
|
||||
## install |
||||
|
||||
```bash |
||||
# npm |
||||
$ echo @kay:registry=https://code.juke.fr/api/packages/kay/npm/ >> .npmrc |
||||
$ npm install @kay/komponents |
||||
``` |
||||
|
||||
```bash |
||||
# yarn |
||||
echo \"@kay:registry\" \"https://code.juke.fr/api/packages/kay/npm/\" >> .yarnrc |
||||
$ yarn add @kay/komponents |
||||
``` |
||||
|
||||
## usage |
||||
|
||||
### storybook |
||||
|
||||
a storybook is availble on [komponents.comfy.center](https://komponents.comfy.center) |
||||
|
||||
|
||||
## License |
||||
|
||||
Most all of my work is now licensed under **a modified** [CC-BY-NC-SA 4.0 AFEdit](https://code.juke.fr/kay/license/raw/branch/main/LICENSE) plus accounting for states existing in our world on top of capitalism. |
||||
|
||||
This is a weird choice for code right? |
||||
|
||||
Here are a few key reasons: |
||||
- my definition of "open" involves being able to share and modify, you are able to do such things, just not make money off of it, or oppress people |
||||
- my definition of "free" involves being able to share and modify, you are able to do such things, not just make money off of it, or oppressing people |
||||
|
||||
So no, amongst other things, this list is not exhaustive, |
||||
- you cannot have somebody work on my tool and redistribute it to your employees |
||||
- you cannot resell copies of this because in this age distribution is not done with floppy disks and the internet is a thing |
||||
- you cannot use it to generate revenue yourself |
||||
- you cannot use it to "generate value" in a capitalistic sense |
||||
- you cannot use it in any military capacity |
||||
- you cannot use it in any law enforcement capacity |
||||
- you cannot use it in any state backed capacity |
||||
- you cannot use it in any surveillance capacity |
||||
- you cannot use it if you represent the interests of a state |
||||
- you cannot use it to oppress, spy, control in any capacity |
||||
- you cannot use it to injure, harm, kill, whether physically or psychologically |
||||
|
||||
You can, however, |
||||
- change it to do whatever you please |
||||
- share it to anyone you please with attribution and under the same license |
||||
- use it as much as you please |
||||
- and probably a bunch of other cool things that are possible outside of a capitalistic, imperialistic frame of reference that permeates the tech scene |
||||
|
||||
Most of the "arguments" for how "free" and "open" source licenses are done still to this day stem from archaic concepts that might not even be relevant these days and I fail to see the issue with this license not being "interoperable" with a bunch of what I deem to be "bad" licenses, as they all allow for commercial usage. |
||||
|
||||
I also will not make any attempts to monetize these works and will at most ever offer the possibility to donate to me directly if you enjoy what I do. |
||||
|
||||
Thank you that is all. |
||||
|
||||
## Development |
||||
|
||||
To clone the repository locally: |
||||
|
||||
```bash |
||||
$ git clone https://code.juke.fr/kay/komponents.git |
||||
``` |
||||
|
||||
## Contributing |
||||
|
||||
More to come later. |
||||
|
||||
### Issues |
||||
Open new issues by mailing [eutychia.gitlab+komponents-issue@gmail.com](mailto:eutychia.gitlab+komponents-issue@gmail.com) |
||||
|
||||
--- |
||||
beep boop |
||||
|
@ -0,0 +1,85 @@ |
||||
{ |
||||
"name": "@kay/komponents", |
||||
"version": "1.6.0", |
||||
"license": "SEE LICENSE IN LICENSE.CNPLv7+.md", |
||||
"author": "k <site@juke.fr>", |
||||
"main": "dist/cjs/index.js", |
||||
"module": "dist/esm/index.js", |
||||
"types": "dist/cjs/index.d.ts", |
||||
"files": [ |
||||
"dist" |
||||
], |
||||
"scripts": { |
||||
"build:install": "yarn", |
||||
"build:cjs": "tsc --module commonjs --target es6 --outDir dist/cjs", |
||||
"build:esm": "tsc --module es6 --target es6 --outDir dist/esm", |
||||
"build": "yarn build:install && yarn build:cjs && yarn build:esm", |
||||
"storybook": "start-storybook -p 6006", |
||||
"build-storybook": "build-storybook", |
||||
"test-storybook": "test-storybook", |
||||
"test": "npx playwright install && yarn build-storybook && npx -y concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"npx -y http-server storybook-static --port 6006 --silent\" \"npx -y wait-on tcp:6006 && yarn test-storybook -s\"" |
||||
}, |
||||
"dependencies": { |
||||
"@chakra-ui/icons": "^2.0.2", |
||||
"@chakra-ui/react": "^2.2.1", |
||||
"@emotion/react": "^11.9.3", |
||||
"@emotion/styled": "^11.9.3", |
||||
"@react-three/a11y": "^3.0.0", |
||||
"@react-three/fiber": "^8.0.27", |
||||
"@reduxjs/toolkit": "^1.8.2", |
||||
"@semantic-release/changelog": "^6.0.1", |
||||
"@semantic-release/git": "^10.0.1", |
||||
"@semantic-release/gitlab": "^9.3.2", |
||||
"@semantic-release/npm": "^9.0.1", |
||||
"framer-motion": "^6.3.15", |
||||
"next": "^12.1.6", |
||||
"react": "^18.2.0", |
||||
"react-dom": "^18.2.0", |
||||
"react-spring": "^9.4.5", |
||||
"semantic-release": "^19.0.3", |
||||
"three": "^0.141.0" |
||||
}, |
||||
"devDependencies": { |
||||
"@a110/storybook-expand-all": "^1.0.9", |
||||
"@babel/core": "^7.18.6", |
||||
"@chakra-ui/storybook-addon": "^4.0.1", |
||||
"@chakra-ui/utils": "^2.0.2", |
||||
"@next/bundle-analyzer": "^12.1.6", |
||||
"@next/eslint-plugin-next": "^12.1.6", |
||||
"@playwright/test": "^1.22.2", |
||||
"@storybook/addon-a11y": "^6.5.9", |
||||
"@storybook/addon-actions": "^6.5.9", |
||||
"@storybook/addon-essentials": "^6.5.9", |
||||
"@storybook/addon-interactions": "^6.5.9", |
||||
"@storybook/addon-jest": "^6.5.9", |
||||
"@storybook/addon-links": "^6.5.9", |
||||
"@storybook/addon-storyshots": "^6.5.9", |
||||
"@storybook/addon-storysource": "^6.5.9", |
||||
"@storybook/builder-webpack5": "^6.5.9", |
||||
"@storybook/jest": "^0.0.10", |
||||
"@storybook/manager-webpack5": "^6.5.9", |
||||
"@storybook/mdx2-csf": "^0.0.3", |
||||
"@storybook/react": "^6.5.9", |
||||
"@storybook/test-runner": "^0.3.0", |
||||
"@storybook/testing-library": "^0.0.13", |
||||
"@types/node": "^18.0.0", |
||||
"@types/prismjs": "^1.26.0", |
||||
"@types/react": "^18.0.14", |
||||
"@types/react-dom": "^18.0.5", |
||||
"@types/react-lazy-load-image-component": "^1.5.2", |
||||
"@types/three": "^0.141.0", |
||||
"@typescript-eslint/eslint-plugin": "^5.29.0", |
||||
"@typescript-eslint/parser": "^5.29.0", |
||||
"axe-playwright": "^1.1.11", |
||||
"babel-jest": "^28.1.1", |
||||
"babel-loader": "^8.2.5", |
||||
"eslint": "^8.18.0", |
||||
"eslint-config-prettier": "^8.5.0", |
||||
"eslint-plugin-prettier": "^4.0.0", |
||||
"eslint-plugin-react": "^7.30.1", |
||||
"eslint-plugin-storybook": "^0.5.13", |
||||
"jest": "27", |
||||
"prettier": "^2.7.1", |
||||
"typescript": "^4.7.4" |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
import * as React from 'react'; |
||||
import { MoonIcon, SunIcon } from '@chakra-ui/icons'; |
||||
import { IconButton, useColorMode, useColorModeValue } from '@chakra-ui/react'; |
||||
import { AnimatePresence, motion } from 'framer-motion'; |
||||
|
||||
export function ColorModeToggle() { |
||||
const { toggleColorMode } = useColorMode(); |
||||
return ( |
||||
<AnimatePresence exitBeforeEnter initial={false} key={'themeToggleBtn'}> |
||||
<motion.div |
||||
style={{ display: 'inline-block' }} |
||||
key={useColorModeValue('light', 'dark')} |
||||
initial={{ y: -10, opacity: 0 }} |
||||
animate={{ y: 0, opacity: 1 }} |
||||
exit={{ y: 10, opacity: 0 }} |
||||
transition={{ duration: 0.2 }} |
||||
> |
||||
<IconButton |
||||
aria-label="Toggle theme" |
||||
colorScheme={useColorModeValue('gray', 'orange')} |
||||
icon={useColorModeValue(<MoonIcon />, <SunIcon />)} |
||||
onClick={toggleColorMode} |
||||
></IconButton> |
||||
</motion.div> |
||||
</AnimatePresence> |
||||
); |
||||
} |
@ -0,0 +1,73 @@ |
||||
import React from 'react'; |
||||
import { |
||||
Flex, |
||||
Link, |
||||
Button, |
||||
Heading, |
||||
Text, |
||||
Spacer, |
||||
Box, |
||||
Stack, |
||||
useBreakpointValue, |
||||
} from '@chakra-ui/react'; |
||||
|
||||
const LinkComponent = ({ |
||||
href, |
||||
text, |
||||
target, |
||||
}: { |
||||
href?: string; |
||||
text?: string; |
||||
target?: string; |
||||
}) => ( |
||||
<Button target={target} as="a" variant="ghost" href={href}> |
||||
{' '} |
||||
<Text>{text}</Text> |
||||
</Button> |
||||
); |
||||
|
||||
export const Header = ({ |
||||
icons, |
||||
title, |
||||
links, |
||||
}: { |
||||
icons: any[]; |
||||
title: string; |
||||
links: { href: string; text: string; target: string }[]; |
||||
}) => ( |
||||
<Flex |
||||
as="nav" |
||||
mb={12} |
||||
align="center" |
||||
justify="space-between" |
||||
justifyContent={['center', 'center', 'initial', 'initial']} |
||||
wrap="wrap" |
||||
w="100%" |
||||
> |
||||
<Stack |
||||
spacing={2} |
||||
align="center" |
||||
justify={['center', 'space-between', 'initial', 'initial']} |
||||
direction={['column', 'row', 'row', 'row']} |
||||
pt={[3, 3, 0, 0]} |
||||
w="100%" |
||||
wrap="wrap" |
||||
> |
||||
<Button variant="ghost" mr={3} as="a" href="/"> |
||||
{' '} |
||||
<Heading letterSpacing={'tighter'} size="md" as="h1"> |
||||
{title} |
||||
</Heading> |
||||
</Button> |
||||
|
||||
{links && links.map((link) => <LinkComponent {...link} />)} |
||||
<Box |
||||
style={{ |
||||
marginLeft: useBreakpointValue({ sm: 'auto' }), |
||||
}} |
||||
> |
||||
{icons && icons.map((icon) => icon)} |
||||
</Box> |
||||
</Stack> |
||||
</Flex> |
||||
); |
@ -0,0 +1,133 @@ |
||||
import { extendTheme, ThemeConfig } from '@chakra-ui/react'; |
||||
|
||||
// 2. Add your color mode config
|
||||
const config: ThemeConfig = { |
||||
useSystemColorMode: true, |
||||
initialColorMode: 'system', |
||||
}; |
||||
// 3. extend the theme
|
||||
export const draculaTheme = extendTheme({ |
||||
config, |
||||
colors: { |
||||
gray: { |
||||
'50': '#F0F1F4', |
||||
'100': '#D6D8E1', |
||||
'200': '#BCBECD', |
||||
'300': '#A1A5BA', |
||||
'400': '#878BA6', |
||||
'500': '#6D7292', |
||||
'600': '#575B75', |
||||
'700': '#414458', |
||||
'800': '#2B2E3B', |
||||
'900': '#16171D', |
||||
}, |
||||
pink: { |
||||
'50': '#FFE5F4', |
||||
'100': '#FFB8E1', |
||||
'200': '#FF8ACD', |
||||
'300': '#FF5CBA', |
||||
'400': '#FF2EA6', |
||||
'500': '#FF0093', |
||||
'600': '#CC0075', |
||||
'700': '#990058', |
||||
'800': '#66003B', |
||||
'900': '#33001D', |
||||
}, |
||||
purple: { |
||||
'50': '#F0E7FE', |
||||
'100': '#D6BBFB', |
||||
'200': '#BB90F9', |
||||
'300': '#A164F6', |
||||
'400': '#8639F4', |
||||
'500': '#6B0DF2', |
||||
'600': '#560BC1', |
||||
'700': '#400891', |
||||
'800': '#2B0561', |
||||
'900': '#150330', |
||||
}, |
||||
blue: { |
||||
'50': '#EFF1F6', |
||||
'100': '#D2D6E5', |
||||
'200': '#B5BCD4', |
||||
'300': '#98A2C3', |
||||
'400': '#7B88B2', |
||||
'500': '#5E6EA1', |
||||
'600': '#4B5881', |
||||
'700': '#384261', |
||||
'800': '#252C41', |
||||
'900': '#131620', |
||||
}, |
||||
cyan: { |
||||
'50': '#E6FAFF', |
||||
'100': '#B9F2FE', |
||||
'200': '#8CE9FD', |
||||
'300': '#5FE1FC', |
||||
'400': '#31D8FB', |
||||
'500': '#04CFFB', |
||||
'600': '#03A6C9', |
||||
'700': '#037C96', |
||||
'800': '#025364', |
||||
'900': '#012932', |
||||
}, |
||||
green: { |
||||
'50': '#E6FEEC', |
||||
'100': '#BAFDCB', |
||||
'200': '#8DFCA9', |
||||
'300': '#60FA87', |
||||
'400': '#34F966', |
||||
'500': '#07F844', |
||||
'600': '#06C636', |
||||
'700': '#049529', |
||||
'800': '#03631B', |
||||
'900': '#01320E', |
||||
}, |
||||
yellow: { |
||||
'50': '#FCFEE7', |
||||
'100': '#F7FCBB', |
||||
'200': '#F1FA8F', |
||||
'300': '#ECF863', |
||||
'400': '#E7F637', |
||||
'500': '#E1F40B', |
||||
'600': '#B4C408', |
||||
'700': '#879306', |
||||
'800': '#5A6204', |
||||
'900': '#2D3102', |
||||
}, |
||||
orange: { |
||||
'50': '#FFF3E5', |
||||
'100': '#FFDDB8', |
||||
'200': '#FFC68A', |
||||
'300': '#FFB05C', |
||||
'400': '#FF9A2E', |
||||
'500': '#FF8400', |
||||
'600': '#CC6900', |
||||
'700': '#994F00', |
||||
'800': '#663500', |
||||
'900': '#331A00', |
||||
}, |
||||
red: { |
||||
'50': '#FFE5E5', |
||||
'100': '#FFB8B8', |
||||
'200': '#FF8A8A', |
||||
'300': '#FF5C5C', |
||||
'400': '#FF2E2E', |
||||
'500': '#FF0000', |
||||
'600': '#CC0000', |
||||
'700': '#990000', |
||||
'800': '#660000', |
||||
'900': '#330000', |
||||
}, |
||||
teal: { |
||||
'50': '#F0F1F4', |
||||
'100': '#D6D8E0', |
||||
'200': '#BCBECD', |
||||
'300': '#A2A5B9', |
||||
'400': '#888CA5', |
||||
'500': '#6E7391', |
||||
'600': '#585C74', |
||||
'700': '#424557', |
||||
'800': '#2C2E3A', |
||||
'900': '#16171D', |
||||
}, |
||||
}, |
||||
}); |
@ -0,0 +1,3 @@ |
||||
export { ColorModeToggle } from './ColorModeToggle'; |
||||
export { draculaTheme } from './draculaTheme'; |
||||
export { Header } from './Header'; |
@ -0,0 +1,41 @@ |
||||
import { Canvas, Meta, Story } from '@storybook/addon-docs'; |
||||
|
||||
import { within, userEvent, waitFor } from '@storybook/testing-library'; |
||||
|
||||
import { expect } from '@storybook/jest'; |
||||
|
||||
import { ColorModeToggle } from '../../src/Chakra/ColorModeToggle'; |
||||
|
||||
import { Center } from '@chakra-ui/react'; |
||||
|
||||
<Meta title="Chakra/ColorModeToggle" component={ColorModeToggle} /> |
||||
|
||||
export const decorator = (Story) => ( |
||||
<Center m={10}> |
||||
<Story /> |
||||
</Center> |
||||
); |
||||
|
||||
# ColorModeToggle |
||||
|
||||
This is a simple component to toggle the dark or light mode themes. |
||||
|
||||
<Canvas> |
||||
<Story name="Default" decorators={[decorator]}> |
||||
<ColorModeToggle /> |
||||
</Story> |
||||
</Canvas> |
||||
|
||||
<Canvas> |
||||
<Story |
||||
name="Toggle Color" |
||||
decorators={[decorator]} |
||||
play={async ({ canvasElement }) => { |
||||
const canvas = within(canvasElement); |
||||
await waitFor(() => {}, canvas.getByRole('button')); |
||||
await userEvent.click(canvas.getByRole('button')); |
||||
}} |
||||
> |
||||
<ColorModeToggle /> |
||||
</Story> |
||||
</Canvas> |
@ -0,0 +1,82 @@ |
||||
import { Canvas, Meta, Story } from '@storybook/addon-docs'; |
||||
|
||||
import { within, userEvent, waitFor } from '@storybook/testing-library'; |
||||
|
||||
import { expect } from '@storybook/jest'; |
||||
|
||||
import { Header } from '../../src/Chakra/Header'; |
||||
import { ColorModeToggle } from '../../src/Chakra/ColorModeToggle'; |
||||
|
||||
import { Center, Container } from '@chakra-ui/react'; |
||||
|
||||
<Meta title="Chakra/Header" component={Header} /> |
||||
|
||||
export const decorator = (Story) => ( |
||||
<Container maxW="container.lg"> |
||||
<Story /> |
||||
</Container> |
||||
); |
||||
|
||||
export const Template = (args) => <Header {...args} />; |
||||
|
||||
# Header |
||||
|
||||
a header component, you can pass it links and icons |
||||
|
||||
<Canvas> |
||||
<Story |
||||
name="Default" |
||||
decorators={[decorator]} |
||||
args={{ |
||||
title: 'komponents', |
||||
}} |
||||
> |
||||
{Template.bind({})} |
||||
</Story> |
||||
</Canvas> |
||||
|
||||
<Canvas> |
||||
<Story |
||||
name="Links" |
||||
decorators={[decorator]} |
||||
args={{ |
||||
title: 'komponents', |
||||
links: [ |
||||
{ text: 'about', target: '_self', href: '#about' }, |
||||
{ text: 'search', target: '_self', href: '#search' }, |
||||
], |
||||
}} |
||||
> |
||||
{Template.bind({})} |
||||
</Story> |
||||
</Canvas> |
||||
|
||||
<Canvas> |
||||
<Story |
||||
name="Icons" |
||||
decorators={[decorator]} |
||||
args={{ |
||||
title: 'komponents', |
||||
icons: [<ColorModeToggle />], |
||||
}} |
||||
> |
||||
{Template.bind({})} |
||||
</Story> |
||||
</Canvas> |
||||
|
||||
<Canvas> |
||||
<Story |
||||
name="All" |
||||
decorators={[decorator]} |
||||
args={{ |
||||
title: 'komponents', |
||||
links: [ |
||||
{ text: 'about', target: '_self', href: '#about' }, |
||||
{ text: 'search', target: '_self', href: '#search' }, |
||||
], |
||||
icons: [<ColorModeToggle />], |
||||
}} |
||||
> |
||||
{Template.bind({})} |
||||
</Story> |
||||
</Canvas> |
@ -0,0 +1,17 @@ |
||||
import { Meta } from '@storybook/addon-docs'; |
||||
|
||||
<Meta title="Chakra/draculaTheme" /> |
||||
|
||||
# draculaTheme |
||||
|
||||
it is enabled by default on here |
||||
|
||||
## usage |
||||
|
||||
in your code it would look something like |
||||
|
||||
```javascript |
||||
import { draculaTheme } from '@kay/komponents'; |
||||
|
||||
<ChakraProvider theme={draculaTheme}>...</ChakraProvider>; |
||||
``` |
@ -0,0 +1,23 @@ |
||||
import { Meta } from '@storybook/addon-docs'; |
||||
|
||||
<Meta title="Introduction" /> |
||||
|
||||
# komponents |
||||
|
||||
react compoents (mostly chakra-ui based) that i use all over my react apps |
||||
|
||||
## install |
||||
|
||||
inside the repository you are working in you need to add the namespace `@kay` to be served by my gitlab registry |
||||
|
||||
```bash |
||||
# npm |
||||
$ echo @kay:registry=https://code.eutychia.org/api/v4/packages/npm/ >> .npmrc |
||||
$ npm install @kay/komponents |
||||
``` |
||||
|
||||
```bash |
||||
# yarn |
||||
echo \"@kay:registry\" \"https://code.eutychia.org/api/v4/packages/npm/\" >> .yarnrc |
||||
$ yarn add @kay/komponents |
||||
``` |
@ -0,0 +1,20 @@ |
||||
{ |
||||
"compilerOptions": { |
||||
"strict": true, |
||||
"jsx": "react", |
||||
"declaration": true, |
||||
"esModuleInterop": true, |
||||
"outDir": "dist", |
||||
"target": "es6", |
||||
"module": "es6", |
||||
"moduleResolution": "node", |
||||
"skipLibCheck": true |
||||
}, |
||||
"include": [ |
||||
"src/" |
||||
], |
||||
"exclude": [ |
||||
"node_modules", |
||||
"dist" |
||||
] |
||||
} |
Loading…
Reference in new issue